2010-07-06 03:27:41 +02:00
/*
2012-01-01 00:32:13 +01:00
* Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
2010-07-06 03:27:41 +02:00
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
2008-10-21 13:19:26 -05:00
*
2010-07-06 03:27:41 +02:00
* 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.
2008-10-21 13:19:26 -05:00
*
2010-07-06 03:27:41 +02:00
* 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, see <http://www.gnu.org/licenses/>.
2008-10-21 13:19:26 -05:00
*/
2009-10-17 15:51:44 -07:00
2008-10-21 13:19:26 -05:00
/* ScriptData
SDName: Silithus
SD%Complete: 100
2009-09-19 15:14:05 -07:00
SDComment: Quest support: 7785, 8304, 8507.
2008-10-21 13:19:26 -05:00
SDCategory: Silithus
EndScriptData */
2009-10-17 15:51:44 -07:00
2008-10-21 13:19:26 -05:00
/* ContentData
2008-12-13 19:56:53 +01:00
npc_highlord_demitrian
2008-10-21 13:19:26 -05:00
npcs_rutgar_and_frankal
2009-09-19 15:14:05 -07:00
quest_a_pawn_on_the_eternal_pawn
2008-10-21 13:19:26 -05:00
EndContentData */
2009-10-17 15:51:44 -07:00
2010-06-08 23:44:55 +02:00
#include "ScriptPCH.h"
2010-11-29 07:50:31 +01:00
#include "Group.h"
2009-10-17 15:51:44 -07:00
2008-12-13 19:56:53 +01:00
/*###
## npc_highlord_demitrian
###*/
2009-10-17 15:51:44 -07:00
2008-12-13 19:56:53 +01:00
#define GOSSIP_DEMITRIAN1 "What do you know of it?"
2011-09-29 12:43:05 +02:00
#define GOSSIP_DEMITRIAN2 "I am listening, Demitrian."
2008-12-13 19:56:53 +01:00
#define GOSSIP_DEMITRIAN3 "Continue, please."
#define GOSSIP_DEMITRIAN4 "A battle?"
#define GOSSIP_DEMITRIAN5 "<Nod>"
#define GOSSIP_DEMITRIAN6 "Caught unaware? How?"
#define GOSSIP_DEMITRIAN7 "So what did Ragnaros do next?"
2010-08-09 01:52:26 +02:00
class npc_highlord_demitrian : public CreatureScript
2008-12-13 19:56:53 +01:00
{
2010-08-08 22:54:58 +06:00
public :
npc_highlord_demitrian () : CreatureScript ( "npc_highlord_demitrian" ) { }
2009-10-17 15:51:44 -07:00
2011-07-02 22:52:42 +02:00
bool OnGossipSelect ( Player * player , Creature * creature , uint32 /*uiSender*/ , uint32 uiAction )
2010-08-08 22:54:58 +06:00
{
2011-07-02 22:52:42 +02:00
player -> PlayerTalkClass -> ClearMenus ();
2010-08-08 22:54:58 +06:00
switch ( uiAction )
{
case GOSSIP_ACTION_INFO_DEF :
2011-07-02 22:52:42 +02:00
player -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_DEMITRIAN2 , GOSSIP_SENDER_MAIN , GOSSIP_ACTION_INFO_DEF + 1 );
player -> SEND_GOSSIP_MENU ( 6842 , creature -> GetGUID ());
2010-08-08 22:54:58 +06:00
break ;
case GOSSIP_ACTION_INFO_DEF + 1 :
2011-07-02 22:52:42 +02:00
player -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_DEMITRIAN3 , GOSSIP_SENDER_MAIN , GOSSIP_ACTION_INFO_DEF + 2 );
player -> SEND_GOSSIP_MENU ( 6843 , creature -> GetGUID ());
2010-08-08 22:54:58 +06:00
break ;
case GOSSIP_ACTION_INFO_DEF + 2 :
2011-07-02 22:52:42 +02:00
player -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_DEMITRIAN4 , GOSSIP_SENDER_MAIN , GOSSIP_ACTION_INFO_DEF + 3 );
player -> SEND_GOSSIP_MENU ( 6844 , creature -> GetGUID ());
2010-08-08 22:54:58 +06:00
break ;
case GOSSIP_ACTION_INFO_DEF + 3 :
2011-07-02 22:52:42 +02:00
player -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_DEMITRIAN5 , GOSSIP_SENDER_MAIN , GOSSIP_ACTION_INFO_DEF + 4 );
player -> SEND_GOSSIP_MENU ( 6867 , creature -> GetGUID ());
2010-08-08 22:54:58 +06:00
break ;
case GOSSIP_ACTION_INFO_DEF + 4 :
2011-07-02 22:52:42 +02:00
player -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_DEMITRIAN6 , GOSSIP_SENDER_MAIN , GOSSIP_ACTION_INFO_DEF + 5 );
player -> SEND_GOSSIP_MENU ( 6868 , creature -> GetGUID ());
2010-08-08 22:54:58 +06:00
break ;
case GOSSIP_ACTION_INFO_DEF + 5 :
2011-07-02 22:52:42 +02:00
player -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_DEMITRIAN7 , GOSSIP_SENDER_MAIN , GOSSIP_ACTION_INFO_DEF + 6 );
player -> SEND_GOSSIP_MENU ( 6869 , creature -> GetGUID ());
2010-08-08 22:54:58 +06:00
break ;
case GOSSIP_ACTION_INFO_DEF + 6 :
2011-07-02 22:52:42 +02:00
player -> SEND_GOSSIP_MENU ( 6870 , creature -> GetGUID ());
2009-10-17 15:51:44 -07:00
2010-08-08 22:54:58 +06:00
ItemPosCountVec dest ;
2011-07-02 22:52:42 +02:00
uint8 msg = player -> CanStoreNewItem ( NULL_BAG , NULL_SLOT , dest , 19016 , 1 );
2010-08-08 22:54:58 +06:00
if ( msg == EQUIP_ERR_OK )
2011-07-02 22:52:42 +02:00
player -> StoreNewItem ( dest , 19016 , true );
2010-08-08 22:54:58 +06:00
break ;
}
2009-02-09 08:16:34 -05:00
return true ;
2010-08-08 22:54:58 +06:00
}
2009-10-17 15:51:44 -07:00
2011-07-02 22:52:42 +02:00
bool OnGossipHello ( Player * player , Creature * creature )
2009-02-09 08:16:34 -05:00
{
2011-07-02 22:18:03 +02:00
if ( creature -> isQuestGiver ())
2011-07-02 22:52:42 +02:00
player -> PrepareQuestMenu ( creature -> GetGUID ());
2010-08-08 22:54:58 +06:00
2011-07-02 22:52:42 +02:00
if ( player -> GetQuestStatus ( 7785 ) == QUEST_STATUS_NONE &&
( player -> HasItemCount ( 18563 , 1 , false ) || player -> HasItemCount ( 18564 , 1 , false )))
player -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_DEMITRIAN1 , GOSSIP_SENDER_MAIN , GOSSIP_ACTION_INFO_DEF );
2010-08-08 22:54:58 +06:00
2011-07-02 22:52:42 +02:00
player -> SEND_GOSSIP_MENU ( 6812 , creature -> GetGUID ());
2010-08-08 22:54:58 +06:00
return true ;
2009-02-09 08:16:34 -05:00
}
2010-08-08 22:54:58 +06:00
};
2008-10-21 13:19:26 -05:00
/*###
## npcs_rutgar_and_frankal
###*/
2009-10-17 15:51:44 -07:00
2008-10-21 13:19:26 -05:00
//gossip item text best guess
#define GOSSIP_ITEM1 "I seek information about Natalia"
2009-10-17 15:51:44 -07:00
2008-10-21 13:19:26 -05:00
#define GOSSIP_ITEM2 "That sounds dangerous!"
#define GOSSIP_ITEM3 "What did you do?"
#define GOSSIP_ITEM4 "Who?"
#define GOSSIP_ITEM5 "Women do that. What did she demand?"
#define GOSSIP_ITEM6 "What do you mean?"
#define GOSSIP_ITEM7 "What happened next?"
2009-10-17 15:51:44 -07:00
2008-10-21 13:19:26 -05:00
#define GOSSIP_ITEM11 "Yes, please continue"
#define GOSSIP_ITEM12 "What language?"
#define GOSSIP_ITEM13 "The Priestess attacked you?!"
#define GOSSIP_ITEM14 "I should ask the monkey about this"
#define GOSSIP_ITEM15 "Then what..."
2009-10-17 15:51:44 -07:00
2008-10-21 13:19:26 -05:00
//trigger creatures to kill
#define TRIGGER_RUTGAR 15222
#define TRIGGER_FRANKAL 15221
2010-08-09 01:52:26 +02:00
class npcs_rutgar_and_frankal : public CreatureScript
2008-10-21 13:19:26 -05:00
{
2010-08-08 22:54:58 +06:00
public :
npcs_rutgar_and_frankal () : CreatureScript ( "npcs_rutgar_and_frankal" ) { }
2009-10-17 15:51:44 -07:00
2011-07-02 22:52:42 +02:00
bool OnGossipSelect ( Player * player , Creature * creature , uint32 /*uiSender*/ , uint32 uiAction )
2010-08-08 22:54:58 +06:00
{
2011-07-02 22:52:42 +02:00
player -> PlayerTalkClass -> ClearMenus ();
2010-08-08 22:54:58 +06:00
switch ( uiAction )
{
case GOSSIP_ACTION_INFO_DEF :
2011-07-02 22:52:42 +02:00
player -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_ITEM2 , GOSSIP_SENDER_MAIN , GOSSIP_ACTION_INFO_DEF + 1 );
player -> SEND_GOSSIP_MENU ( 7755 , creature -> GetGUID ());
2010-08-08 22:54:58 +06:00
break ;
case GOSSIP_ACTION_INFO_DEF + 1 :
2011-07-02 22:52:42 +02:00
player -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_ITEM3 , GOSSIP_SENDER_MAIN , GOSSIP_ACTION_INFO_DEF + 2 );
player -> SEND_GOSSIP_MENU ( 7756 , creature -> GetGUID ());
2010-08-08 22:54:58 +06:00
break ;
case GOSSIP_ACTION_INFO_DEF + 2 :
2011-07-02 22:52:42 +02:00
player -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_ITEM4 , GOSSIP_SENDER_MAIN , GOSSIP_ACTION_INFO_DEF + 3 );
player -> SEND_GOSSIP_MENU ( 7757 , creature -> GetGUID ());
2010-08-08 22:54:58 +06:00
break ;
case GOSSIP_ACTION_INFO_DEF + 3 :
2011-07-02 22:52:42 +02:00
player -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_ITEM5 , GOSSIP_SENDER_MAIN , GOSSIP_ACTION_INFO_DEF + 4 );
player -> SEND_GOSSIP_MENU ( 7758 , creature -> GetGUID ());
2010-08-08 22:54:58 +06:00
break ;
case GOSSIP_ACTION_INFO_DEF + 4 :
2011-07-02 22:52:42 +02:00
player -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_ITEM6 , GOSSIP_SENDER_MAIN , GOSSIP_ACTION_INFO_DEF + 5 );
player -> SEND_GOSSIP_MENU ( 7759 , creature -> GetGUID ());
2010-08-08 22:54:58 +06:00
break ;
case GOSSIP_ACTION_INFO_DEF + 5 :
2011-07-02 22:52:42 +02:00
player -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_ITEM7 , GOSSIP_SENDER_MAIN , GOSSIP_ACTION_INFO_DEF + 6 );
player -> SEND_GOSSIP_MENU ( 7760 , creature -> GetGUID ());
2010-08-08 22:54:58 +06:00
break ;
case GOSSIP_ACTION_INFO_DEF + 6 :
2011-07-02 22:52:42 +02:00
player -> SEND_GOSSIP_MENU ( 7761 , creature -> GetGUID ());
2010-08-08 22:54:58 +06:00
//'kill' our trigger to update quest status
2011-07-02 22:52:42 +02:00
player -> KilledMonsterCredit ( TRIGGER_RUTGAR , 0 );
2010-08-08 22:54:58 +06:00
break ;
case GOSSIP_ACTION_INFO_DEF + 9 :
2011-07-02 22:52:42 +02:00
player -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_ITEM11 , GOSSIP_SENDER_MAIN , GOSSIP_ACTION_INFO_DEF + 11 );
player -> SEND_GOSSIP_MENU ( 7762 , creature -> GetGUID ());
2010-08-08 22:54:58 +06:00
break ;
case GOSSIP_ACTION_INFO_DEF + 10 :
2011-07-02 22:52:42 +02:00
player -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_ITEM12 , GOSSIP_SENDER_MAIN , GOSSIP_ACTION_INFO_DEF + 11 );
player -> SEND_GOSSIP_MENU ( 7763 , creature -> GetGUID ());
2010-08-08 22:54:58 +06:00
break ;
case GOSSIP_ACTION_INFO_DEF + 11 :
2011-07-02 22:52:42 +02:00
player -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_ITEM13 , GOSSIP_SENDER_MAIN , GOSSIP_ACTION_INFO_DEF + 12 );
player -> SEND_GOSSIP_MENU ( 7764 , creature -> GetGUID ());
2010-08-08 22:54:58 +06:00
break ;
case GOSSIP_ACTION_INFO_DEF + 12 :
2011-07-02 22:52:42 +02:00
player -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_ITEM14 , GOSSIP_SENDER_MAIN , GOSSIP_ACTION_INFO_DEF + 13 );
player -> SEND_GOSSIP_MENU ( 7765 , creature -> GetGUID ());
2010-08-08 22:54:58 +06:00
break ;
case GOSSIP_ACTION_INFO_DEF + 13 :
2011-07-02 22:52:42 +02:00
player -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_ITEM15 , GOSSIP_SENDER_MAIN , GOSSIP_ACTION_INFO_DEF + 14 );
player -> SEND_GOSSIP_MENU ( 7766 , creature -> GetGUID ());
2010-08-08 22:54:58 +06:00
break ;
case GOSSIP_ACTION_INFO_DEF + 14 :
2011-07-02 22:52:42 +02:00
player -> SEND_GOSSIP_MENU ( 7767 , creature -> GetGUID ());
2010-08-08 22:54:58 +06:00
//'kill' our trigger to update quest status
2011-07-02 22:52:42 +02:00
player -> KilledMonsterCredit ( TRIGGER_FRANKAL , 0 );
2010-08-08 22:54:58 +06:00
break ;
}
return true ;
}
2009-10-17 15:51:44 -07:00
2011-07-02 22:52:42 +02:00
bool OnGossipHello ( Player * player , Creature * creature )
2010-08-08 22:54:58 +06:00
{
2011-07-02 22:18:03 +02:00
if ( creature -> isQuestGiver ())
2011-07-02 22:52:42 +02:00
player -> PrepareQuestMenu ( creature -> GetGUID ());
2009-10-17 15:51:44 -07:00
2011-07-02 22:52:42 +02:00
if ( player -> GetQuestStatus ( 8304 ) == QUEST_STATUS_INCOMPLETE &&
2011-07-02 22:18:03 +02:00
creature -> GetEntry () == 15170 &&
2011-07-02 22:52:42 +02:00
! player -> GetReqKillOrCastCurrentCount ( 8304 , TRIGGER_RUTGAR ))
player -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_ITEM1 , GOSSIP_SENDER_MAIN , GOSSIP_ACTION_INFO_DEF );
2009-10-17 15:51:44 -07:00
2011-07-02 22:52:42 +02:00
if ( player -> GetQuestStatus ( 8304 ) == QUEST_STATUS_INCOMPLETE &&
2011-07-02 22:18:03 +02:00
creature -> GetEntry () == 15171 &&
2011-07-02 22:52:42 +02:00
player -> GetReqKillOrCastCurrentCount ( 8304 , TRIGGER_RUTGAR ))
player -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_ITEM1 , GOSSIP_SENDER_MAIN , GOSSIP_ACTION_INFO_DEF + 9 );
2009-10-17 15:51:44 -07:00
2011-07-02 22:52:42 +02:00
player -> SEND_GOSSIP_MENU ( 7754 , creature -> GetGUID ());
2009-10-17 15:51:44 -07:00
2010-08-08 22:54:58 +06:00
return true ;
2008-10-21 13:19:26 -05:00
}
2010-08-08 22:54:58 +06:00
};
2009-09-19 15:14:05 -07:00
/*####
# quest_a_pawn_on_the_eternal_board (Defines)
2008-10-21 13:19:26 -05:00
####*/
2009-10-17 07:42:48 -07:00
enum eEternalBoard
2009-09-19 15:14:05 -07:00
{
QUEST_A_PAWN_ON_THE_ETERNAL_BOARD = 8519 ,
2009-10-17 15:51:44 -07:00
2009-09-19 15:14:05 -07:00
FACTION_HOSTILE = 14 ,
FACTION_FRIENDLY = 35 ,
2009-10-17 15:51:44 -07:00
2009-09-19 15:14:05 -07:00
C_ANACHRONOS = 15381 ,
C_FANDRAL_STAGHELM = 15382 ,
C_ARYGOS = 15380 ,
C_MERITHRA = 15378 ,
C_CAELESTRASZ = 15379 ,
2009-10-17 15:51:44 -07:00
2009-09-19 15:14:05 -07:00
ANACHRONOS_SAY_1 = - 1350000 ,
ANACHRONOS_SAY_2 = - 1350001 ,
ANACHRONOS_SAY_3 = - 1350002 ,
ANACHRONOS_SAY_4 = - 1350003 ,
ANACHRONOS_SAY_5 = - 1350004 ,
ANACHRONOS_SAY_6 = - 1350005 ,
ANACHRONOS_SAY_7 = - 1350006 ,
ANACHRONOS_SAY_8 = - 1350007 ,
ANACHRONOS_SAY_9 = - 1350008 ,
ANACHRONOS_SAY_10 = - 1350009 ,
ANACHRONOS_EMOTE_1 = - 1350010 ,
ANACHRONOS_EMOTE_2 = - 1350011 ,
ANACHRONOS_EMOTE_3 = - 1350012 ,
2009-10-17 15:51:44 -07:00
2009-09-19 15:14:05 -07:00
FANDRAL_SAY_1 = - 1350013 ,
FANDRAL_SAY_2 = - 1350014 ,
FANDRAL_SAY_3 = - 1350015 ,
FANDRAL_SAY_4 = - 1350016 ,
FANDRAL_SAY_5 = - 1350017 ,
FANDRAL_SAY_6 = - 1350018 ,
FANDRAL_EMOTE_1 = - 1350019 ,
FANDRAL_EMOTE_2 = - 1350020 ,
2009-10-17 15:51:44 -07:00
2009-09-19 15:14:05 -07:00
CAELESTRASZ_SAY_1 = - 1350021 ,
CAELESTRASZ_SAY_2 = - 1350022 ,
CAELESTRASZ_YELL_1 = - 1350023 ,
2009-10-17 15:51:44 -07:00
2009-09-19 15:14:05 -07:00
ARYGOS_SAY_1 = - 1350024 ,
ARYGOS_YELL_1 = - 1350025 ,
ARYGOS_EMOTE_1 = - 1350026 ,
2009-10-17 15:51:44 -07:00
2009-09-19 15:14:05 -07:00
MERITHRA_SAY_1 = - 1350027 ,
MERITHRA_SAY_2 = - 1350028 ,
MERITHRA_YELL_1 = - 1350029 ,
MERITHRA_EMOTE_1 = - 1350030 ,
2009-10-17 15:51:44 -07:00
2009-09-19 15:14:05 -07:00
GO_GATE_OF_AHN_QIRAJ = 176146 ,
GO_GLYPH_OF_AHN_QIRAJ = 176148 ,
GO_ROOTS_OF_AHN_QIRAJ = 176147
};
/*#####
# Quest: A Pawn on the Eternal Board
#####*/
2009-10-17 15:51:44 -07:00
2009-09-19 15:14:05 -07:00
/* ContentData
A Pawn on the Eternal Board - creatures, gameobjects and defines
mob_qiraj_war_spawn : Adds that are summoned in the Qiraj gates battle.
npc_anachronos_the_ancient : Creature that controls the event.
npc_anachronos_quest_trigger: controls the spawning of the BG War mobs.
go_crystalline_tear : GameObject that begins the event and hands out quest
TO DO: get correct spell IDs and timings for spells cast upon dragon transformations
2011-04-29 20:47:02 +02:00
TO DO: Dragons should use the HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF) after transformation, but for some unknown reason it doesnt work.
2009-09-19 15:14:05 -07:00
EndContentData */
2009-10-17 15:51:44 -07:00
2009-09-19 15:14:05 -07:00
#define QUEST_A_PAWN_ON_THE_ETERNAL_BOARD 8519
#define EVENT_AREA_RADIUS 65 //65yds
#define EVENT_COOLDOWN 500000 //in ms. appear after event completed or failed (should be = Adds despawn time)
2009-10-17 15:51:44 -07:00
2009-09-19 15:14:05 -07:00
struct QuestCinematic
{
int32 TextId ;
uint32 Creature , Timer ;
};
2009-10-17 15:51:44 -07:00
2009-09-19 15:14:05 -07:00
// Creature 0 - Anachronos, 1 - Fandral, 2 - Arygos, 3 - Merithra, 4 - Caelestrasz
static QuestCinematic EventAnim [] =
{
{ ANACHRONOS_SAY_1 , 0 , 2000 },
{ FANDRAL_SAY_1 , 1 , 4000 },
{ MERITHRA_EMOTE_1 , 3 , 500 },
{ MERITHRA_SAY_1 , 3 , 500 },
{ ARYGOS_EMOTE_1 , 2 , 2000 },
{ CAELESTRASZ_SAY_1 , 4 , 8000 },
{ MERITHRA_SAY_2 , 3 , 6000 },
2011-04-29 20:47:02 +02:00
{ 0 , 3 , 2000 },
2009-09-19 15:14:05 -07:00
{ MERITHRA_YELL_1 , 3 , 2500 },
2011-04-29 20:47:02 +02:00
{ 0 , 3 , 3000 }, //Morph
{ 0 , 3 , 4000 }, //EmoteLiftoff
{ 0 , 3 , 4000 }, // spell
{ 0 , 3 , 1250 }, //fly
{ 0 , 3 , 250 }, //remove flags
2009-09-19 15:14:05 -07:00
{ ARYGOS_SAY_1 , 2 , 3000 },
2011-04-29 20:47:02 +02:00
{ 0 , 3 , 2000 },
2009-09-19 15:14:05 -07:00
{ ARYGOS_YELL_1 , 2 , 3000 },
2011-04-29 20:47:02 +02:00
{ 0 , 3 , 3000 }, //Morph
{ 0 , 3 , 4000 }, //EmoteLiftoff
{ 0 , 3 , 4000 }, // spell
{ 0 , 3 , 1000 }, //fly
{ 0 , 3 , 1000 }, //remove flags
2009-09-19 15:14:05 -07:00
{ CAELESTRASZ_SAY_2 , 4 , 5000 },
2011-04-29 20:47:02 +02:00
{ 0 , 3 , 3000 },
2009-09-19 15:14:05 -07:00
{ CAELESTRASZ_YELL_1 , 4 , 3000 },
2011-04-29 20:47:02 +02:00
{ 0 , 3 , 3000 }, //Morph
{ 0 , 3 , 4000 }, //EmoteLiftoff
{ 0 , 3 , 2500 }, // spell
2009-09-19 15:14:05 -07:00
{ ANACHRONOS_SAY_2 , 0 , 2000 },
2011-04-29 20:47:02 +02:00
{ 0 , 3 , 250 }, //fly
{ 0 , 3 , 25 }, //remove flags
2009-09-19 15:14:05 -07:00
{ FANDRAL_SAY_2 , 1 , 3000 },
2011-04-29 20:47:02 +02:00
{ ANACHRONOS_SAY_3 , 0 , 10000 }, //Both run through the armies
{ 0 , 3 , 2000 }, // Sands will stop
{ 0 , 3 , 8000 }, // Summon Gate
2009-09-19 15:14:05 -07:00
{ ANACHRONOS_SAY_4 , 0 , 4000 },
2011-04-29 20:47:02 +02:00
{ 0 , 0 , 2000 }, //spell 1-> Arcane cosmetic (Mobs freeze)
2011-04-23 15:53:48 +02:00
{ 0 , 0 , 5000 }, //Spell 2-> Arcane long cosmetic (barrier appears) (Barrier -> Glyphs)
2011-04-29 20:47:02 +02:00
{ 0 , 0 , 7000 }, //BarrieR
{ 0 , 0 , 4000 }, //Glyphs
2009-09-19 15:14:05 -07:00
{ ANACHRONOS_SAY_5 , 0 , 2000 },
2011-04-29 20:47:02 +02:00
{ 0 , 0 , 4000 }, // Roots
{ FANDRAL_SAY_3 , 1 , 3000 }, //Root Text
{ FANDRAL_EMOTE_1 , 1 , 3000 }, //falls knee
2009-09-19 15:14:05 -07:00
{ ANACHRONOS_SAY_6 , 0 , 3000 },
{ ANACHRONOS_SAY_7 , 0 , 3000 },
{ ANACHRONOS_SAY_8 , 0 , 8000 },
2011-04-29 20:47:02 +02:00
{ ANACHRONOS_EMOTE_1 , 0 , 1000 }, //Give Scepter
2009-09-19 15:14:05 -07:00
{ FANDRAL_SAY_4 , 1 , 3000 },
2011-04-29 20:47:02 +02:00
{ FANDRAL_SAY_5 , 1 , 3000 }, //->Equip hammer~Scepter, throw it at door
{ FANDRAL_EMOTE_2 , 1 , 3000 }, //Throw hammer at door.
2009-09-19 15:14:05 -07:00
{ ANACHRONOS_SAY_9 , 0 , 3000 },
{ FANDRAL_SAY_6 , 1 , 3000 }, //fandral goes away
{ ANACHRONOS_EMOTE_2 , 0 , 3000 },
{ ANACHRONOS_EMOTE_3 , 0 , 3000 },
2011-04-23 15:53:48 +02:00
{ 0 , 0 , 2000 },
{ 0 , 0 , 2000 },
{ 0 , 0 , 4000 },
2009-09-19 15:14:05 -07:00
{ ANACHRONOS_SAY_10 , 0 , 3000 },
2011-04-23 15:53:48 +02:00
{ 0 , 0 , 2000 },
{ 0 , 0 , 3000 },
{ 0 , 0 , 15000 },
{ 0 , 0 , 5000 },
{ 0 , 0 , 3500 },
{ 0 , 0 , 5000 },
{ 0 , 0 , 3500 },
{ 0 , 0 , 5000 },
{ 0 , 0 , 0 }
2009-09-19 15:14:05 -07:00
};
2009-10-17 15:51:44 -07:00
2009-09-19 15:14:05 -07:00
//Cordinates for Spawns
2010-12-20 12:03:23 +01:00
static const Position SpawnLocation [] =
2009-09-19 15:14:05 -07:00
{
2011-04-29 20:47:02 +02:00
{ - 8085.0f , 1528.0f , 2.61f , 3.141592f }, //Kaldorei Infantry
{ - 8080.0f , 1526.0f , 2.61f , 3.141592f }, //Kaldorei Infantry
{ - 8085.0f , 1524.0f , 2.61f , 3.141592f }, //Kaldorei Infantry
{ - 8080.0f , 1522.0f , 2.61f , 3.141592f }, //Kaldorei Infantry
{ - 8085.0f , 1520.0f , 2.61f , 3.141592f }, //Kaldorei Infantry
{ - 8085.0f , 1524.0f , 2.61f , 3.141592f }, //Kaldorei Infantry
{ - 8080.0f , 1522.0f , 2.61f , 3.141592f }, //Kaldorei Infantry
{ - 8085.0f , 1520.0f , 2.61f , 3.141592f }, //Kaldorei Infantry
{ - 8080.0f , 1518.0f , 2.61f , 3.141592f }, //Kaldorei Infantry
{ - 8085.0f , 1516.0f , 2.61f , 3.141592f }, //Kaldorei Infantry
{ - 8085.0f , 1518.0f , 2.61f , 3.141592f }, //Kaldorei Infantry
{ - 8080.0f , 1516.0f , 2.61f , 3.141592f }, //Kaldorei Infantry
{ - 8080.0f , 1520.0f , 2.61f , 3.141592f }, //Kaldorei Infantry
{ - 8080.0f , 1424.0f , 2.61f , 3.141592f }, //Kaldorei Infantry
{ - 8085.0f , 1422.0f , 2.61f , 3.141592f }, //Kaldorei Infantry
2009-09-19 15:14:05 -07:00
// 2 waves of warriors
2011-04-29 20:47:02 +02:00
{ - 8082.0f , 1528.0f , 2.61f , 3.141592f }, //Kaldorei Infantry
{ - 8078.0f , 1525.0f , 2.61f , 3.141592f }, //Kaldorei Infantry
{ - 8082.0f , 1524.0f , 2.61f , 3.141592f }, //Kaldorei Infantry
{ - 8078.0f , 1526.0f , 2.61f , 3.141592f }, //Kaldorei Infantry
{ - 8082.0f , 1527.0f , 2.61f , 3.141592f }, //Kaldorei Infantry
{ - 8082.0f , 1524.0f , 2.61f , 3.141592f }, //Kaldorei Infantry
{ - 8078.0f , 1522.0f , 2.61f , 3.141592f }, //Kaldorei Infantry
{ - 8082.0f , 1520.0f , 2.61f , 3.141592f }, //Kaldorei Infantry
{ - 8078.0f , 1518.0f , 2.61f , 3.141592f }, //Kaldorei Infantry
{ - 8082.0f , 1516.0f , 2.61f , 3.141592f }, //Kaldorei Infantry
{ - 8082.0f , 1523.0f , 2.61f , 3.141592f }, //Kaldorei Infantry
{ - 8078.0f , 1521.0f , 2.61f , 3.141592f }, //Kaldorei Infantry
{ - 8082.0f , 1528.0f , 2.61f , 3.141592f }, //Kaldorei Infantry
{ - 8078.0f , 1519.0f , 2.61f , 3.141592f }, //Kaldorei Infantry
{ - 8082.0f , 1526.0f , 2.61f , 3.141592f }, //Kaldorei Infantry
{ - 8082.0f , 1524.0f , 2.61f , 3.141592f }, //Kaldorei Infantry
{ - 8078.0f , 1522.0f , 2.61f , 3.141592f }, //Kaldorei Infantry
{ - 8082.0f , 1520.0f , 2.61f , 3.141592f }, //Kaldorei Infantry
{ - 8078.0f , 1518.0f , 2.61f , 3.141592f }, //Kaldorei Infantry
{ - 8082.0f , 1516.0f , 2.61f , 3.141592f }, //Kaldorei Infantry
{ - 8088.0f , 1510.0f , 2.61f , 0.0f }, //Anubisath Conqueror
{ - 8084.0f , 1520.0f , 2.61f , 0.0f }, //Anubisath Conqueror
{ - 8088.0f , 1530.0f , 2.61f , 0.0f }, //Anubisath Conqueror
{ - 8080.0f , 1513.0f , 2.61f , 0.0f }, //Qiraj Wasp
{ - 8082.0f , 1523.0f , 2.61f , 0.0f }, //Qiraj Wasp
{ - 8085.0f , 1518.0f , 2.61f , 0.0f }, //Qiraj Wasp
{ - 8082.0f , 1516.0f , 2.61f , 0.0f }, //Qiraj Wasp
{ - 8085.0f , 1520.0f , 2.61f , 0.0f }, //Qiraj Wasp
{ - 8080.0f , 1528.0f , 2.61f , 0.0f }, //Qiraj Wasp
{ - 8082.0f , 1513.0f , 2.61f , 0.0f }, //Qiraj Wasp
{ - 8079.0f , 1523.0f , 2.61f , 0.0f }, //Qiraj Wasp
{ - 8080.0f , 1531.0f , 2.61f , 0.0f }, //Qiraj Wasp
{ - 8079.0f , 1516.0f , 2.61f , 0.0f }, //Qiraj Wasp
{ - 8082.0f , 1520.0f , 2.61f , 0.0f }, //Qiraj Wasp
{ - 8080.0f , 1518.0f , 2.61f , 0.0f }, //Qiraj Wasp
{ - 8081.0f , 1514.0f , 2.61f , 0.0f }, //Qiraj Tank
{ - 8081.0f , 1520.0f , 2.61f , 0.0f }, //Qiraj Tank
{ - 8081.0f , 1526.0f , 2.61f , 0.0f }, //Qiraj Tank
{ - 8081.0f , 1512.0f , 2.61f , 0.0f }, //Qiraj Tank
{ - 8082.0f , 1520.0f , 2.61f , 0.0f }, //Qiraj Tank
{ - 8081.0f , 1528.0f , 2.61f , 0.0f }, //Qiraj Tank
{ - 8082.0f , 1513.0f , 2.61f , 3.141592f }, //Anubisath Conqueror
{ - 8082.0f , 1520.0f , 2.61f , 3.141592f }, //Anubisath Conqueror
{ - 8082.0f , 1527.0f , 2.61f , 3.141592f }, //Anubisath Conqueror
2009-09-19 15:14:05 -07:00
};
2009-10-17 15:51:44 -07:00
2009-09-19 15:14:05 -07:00
struct WaveData
{
uint8 SpawnCount , UsedSpawnPoint ;
uint32 CreatureId , SpawnTimer , YellTimer , DespTimer ;
int32 WaveTextId ;
};
2009-10-17 15:51:44 -07:00
2009-09-19 15:14:05 -07:00
static WaveData WavesInfo [] =
{
2010-12-20 12:03:23 +01:00
{ 30 , 0 , 15423 , 0 , 0 , 24000 , 0 }, // Kaldorei Soldier
{ 3 , 35 , 15424 , 0 , 0 , 24000 , 0 }, // Anubisath Conqueror
{ 12 , 38 , 15414 , 0 , 0 , 24000 , 0 }, // Qiraji Wasps
{ 6 , 50 , 15422 , 0 , 0 , 24000 , 0 }, // Qiraji Tanks
{ 15 , 15 , 15423 , 0 , 0 , 24000 , 0 } // Kaldorei Soldier
2009-10-17 15:51:44 -07:00
2009-09-19 15:14:05 -07:00
};
2009-10-17 15:51:44 -07:00
2009-09-19 15:14:05 -07:00
struct SpawnSpells
{
uint32 Timer1 , Timer2 , SpellId ;
};
2009-10-17 15:51:44 -07:00
2009-09-19 15:14:05 -07:00
static SpawnSpells SpawnCast [] = //
{
{ 100000 , 2000 , 33652 }, // Stop Time
{ 38500 , 300000 , 28528 }, // Poison Cloud
{ 58000 , 300000 , 35871 }, // Frost Debuff (need correct spell)
{ 80950 , 300000 , 42075 }, // Fire Explosion (need correct spell however this one looks cool)
};
/*#####
# npc_anachronos_the_ancient
2010-08-09 01:52:26 +02:00
######*/
class npc_anachronos_the_ancient : public CreatureScript
2009-09-19 15:14:05 -07:00
{
2010-08-08 22:54:58 +06:00
public :
npc_anachronos_the_ancient () : CreatureScript ( "npc_anachronos_the_ancient" ) { }
2009-10-17 15:51:44 -07:00
2010-08-14 10:28:45 +02:00
CreatureAI * GetAI ( Creature * c ) const
2009-09-19 15:14:05 -07:00
{
2010-08-08 22:54:58 +06:00
return new npc_anachronos_the_ancientAI ( c );
2009-09-19 15:14:05 -07:00
}
2009-10-17 15:51:44 -07:00
2010-08-08 22:54:58 +06:00
struct npc_anachronos_the_ancientAI : public ScriptedAI
2009-09-19 15:14:05 -07:00
{
2010-08-08 22:54:58 +06:00
npc_anachronos_the_ancientAI ( Creature * c ) : ScriptedAI ( c ) {}
2009-10-17 15:51:44 -07:00
2010-08-08 22:54:58 +06:00
uint32 AnimationTimer ;
uint8 AnimationCount ;
2009-10-17 15:51:44 -07:00
2010-08-08 22:54:58 +06:00
uint64 AnachronosQuestTriggerGUID ;
uint64 MerithraGUID ;
uint64 ArygosGUID ;
uint64 CaelestraszGUID ;
uint64 FandralGUID ;
uint64 PlayerGUID ;
bool eventEnd ;
void Reset ()
{
AnimationTimer = 1500 ;
AnimationCount = 0 ;
AnachronosQuestTriggerGUID = 0 ;
MerithraGUID = 0 ;
ArygosGUID = 0 ;
CaelestraszGUID = 0 ;
FandralGUID = 0 ;
PlayerGUID = 0 ;
eventEnd = false ;
me -> SetFlag ( UNIT_FIELD_FLAGS , UNIT_FLAG_NON_ATTACKABLE );
}
2009-10-17 15:51:44 -07:00
2010-08-08 22:54:58 +06:00
void HandleAnimation ()
2009-09-19 15:14:05 -07:00
{
2011-07-01 03:00:39 +02:00
Player * player = Unit :: GetPlayer ( * me , PlayerGUID );
if ( ! player )
2010-08-08 22:54:58 +06:00
return ;
2011-07-01 03:00:39 +02:00
Unit * Fandral = player -> FindNearestCreature ( C_FANDRAL_STAGHELM , 100.0f , me );
Unit * Arygos = player -> FindNearestCreature ( C_ARYGOS , 100.0f , me );
Unit * Caelestrasz = player -> FindNearestCreature ( C_CAELESTRASZ , 100.0f , me );
Unit * Merithra = player -> FindNearestCreature ( C_MERITHRA , 100.0f , me );
2010-08-08 22:54:58 +06:00
if ( ! Fandral || ! Arygos || ! Caelestrasz || ! Merithra )
return ;
2010-12-20 12:03:23 +01:00
Unit * mob = NULL ;
2010-08-08 22:54:58 +06:00
AnimationTimer = EventAnim [ AnimationCount ]. Timer ;
if ( eventEnd == false )
2009-09-19 15:14:05 -07:00
{
2010-12-20 12:03:23 +01:00
switch ( AnimationCount )
2010-04-19 17:03:10 +02:00
{
2010-08-08 22:54:58 +06:00
case 0 :
2011-09-29 12:43:05 +02:00
DoScriptText ( ANACHRONOS_SAY_1 , me , Fandral );
2010-08-08 22:54:58 +06:00
break ;
case 1 :
2011-07-15 12:33:03 +02:00
Fandral -> SetTarget ( me -> GetGUID ());
2011-04-29 20:47:02 +02:00
DoScriptText ( FANDRAL_SAY_1 , Fandral , me );
2010-08-08 22:54:58 +06:00
break ;
case 2 :
2011-07-15 12:33:03 +02:00
Fandral -> SetTarget ( 0 );
2011-04-29 20:47:02 +02:00
DoScriptText ( MERITHRA_EMOTE_1 , Merithra );
2010-08-08 22:54:58 +06:00
break ;
case 3 :
2011-04-29 20:47:02 +02:00
DoScriptText ( MERITHRA_SAY_1 , Merithra );
2010-08-08 22:54:58 +06:00
break ;
case 4 :
2011-04-29 20:47:02 +02:00
DoScriptText ( ARYGOS_EMOTE_1 , Arygos );
2010-08-08 22:54:58 +06:00
break ;
case 5 :
2011-07-15 12:33:03 +02:00
Caelestrasz -> SetTarget ( Fandral -> GetGUID ());
2010-08-08 22:54:58 +06:00
DoScriptText ( CAELESTRASZ_SAY_1 , Caelestrasz );
break ;
case 6 :
DoScriptText ( MERITHRA_SAY_2 , Merithra );
break ;
case 7 :
2011-07-15 12:33:03 +02:00
Caelestrasz -> SetTarget ( 0 );
2011-04-29 20:47:02 +02:00
Merithra -> GetMotionMaster () -> MoveCharge ( - 8065 , 1530 , 2.61f , 10 );
2010-08-08 22:54:58 +06:00
break ;
case 8 :
2011-04-29 20:47:02 +02:00
DoScriptText ( MERITHRA_YELL_1 , Merithra );
2010-08-08 22:54:58 +06:00
break ;
case 9 :
2011-04-29 20:47:02 +02:00
Merithra -> CastSpell ( Merithra , 25105 , true );
2010-08-08 22:54:58 +06:00
break ;
case 10 :
Merithra -> HandleEmoteCommand ( EMOTE_ONESHOT_LIFTOFF );
2012-02-23 12:32:21 +01:00
Merithra -> SetLevitate ( true );
2011-04-29 20:47:02 +02:00
Merithra -> GetMotionMaster () -> MoveCharge ( - 8065 , 1530 , 6.61f , 3 );
2010-08-08 22:54:58 +06:00
break ;
case 11 :
2011-04-29 20:47:02 +02:00
Merithra -> CastSpell ( Merithra , 24818 , false );
2010-08-08 22:54:58 +06:00
break ;
case 12 :
2011-04-29 20:47:02 +02:00
Merithra -> GetMotionMaster () -> MoveCharge ( - 8100 , 1530 , 50 , 42 );
2010-08-08 22:54:58 +06:00
break ;
case 13 :
break ;
case 14 :
2011-04-29 20:47:02 +02:00
DoScriptText ( ARYGOS_SAY_1 , Arygos );
2010-11-16 01:13:04 +01:00
Merithra -> SetVisible ( false );
2010-08-08 22:54:58 +06:00
break ;
case 15 :
2011-04-29 20:47:02 +02:00
Arygos -> GetMotionMaster () -> MoveCharge ( - 8065 , 1530 , 2.61f , 10 );
Merithra -> GetMotionMaster () -> MoveCharge ( - 8034.535f , 1535.14f , 2.61f , 42 );
2010-08-08 22:54:58 +06:00
break ;
case 16 :
DoScriptText ( ARYGOS_YELL_1 , Arygos );
break ;
case 17 :
2011-04-29 20:47:02 +02:00
Arygos -> CastSpell ( Arygos , 25107 , true );
2010-08-08 22:54:58 +06:00
break ;
case 18 :
Arygos -> HandleEmoteCommand ( EMOTE_ONESHOT_LIFTOFF );
2012-02-23 12:32:21 +01:00
Arygos -> SetLevitate ( true );
2011-04-29 20:47:02 +02:00
Arygos -> GetMotionMaster () -> MoveCharge ( - 8065 , 1530 , 6.61f , 42 );
2010-08-08 22:54:58 +06:00
break ;
case 19 :
2011-04-29 20:47:02 +02:00
Arygos -> CastSpell ( Arygos , 50505 , false );
2010-08-08 22:54:58 +06:00
break ;
case 20 :
2011-04-29 20:47:02 +02:00
Arygos -> GetMotionMaster () -> MoveCharge ( - 8095 , 1530 , 50 , 42 );
2010-08-08 22:54:58 +06:00
break ;
case 21 :
break ;
case 22 :
2011-04-29 20:47:02 +02:00
DoScriptText ( CAELESTRASZ_SAY_2 , Caelestrasz , Fandral );
2010-08-08 22:54:58 +06:00
break ;
case 23 :
2011-04-29 20:47:02 +02:00
Caelestrasz -> GetMotionMaster () -> MoveCharge ( - 8065 , 1530 , 2.61f , 10 );
2010-11-16 01:13:04 +01:00
Arygos -> SetVisible ( false );
2011-04-29 20:47:02 +02:00
Arygos -> GetMotionMaster () -> MoveCharge ( - 8034.535f , 1535.14f , 2.61f , 10 );
2010-08-08 22:54:58 +06:00
break ;
case 24 :
DoScriptText ( CAELESTRASZ_YELL_1 , Caelestrasz );
break ;
case 25 :
2011-04-29 20:47:02 +02:00
Caelestrasz -> CastSpell ( Caelestrasz , 25106 , true );
2010-08-08 22:54:58 +06:00
break ;
case 26 :
Caelestrasz -> HandleEmoteCommand ( 254 );
2012-02-23 12:32:21 +01:00
Caelestrasz -> SetLevitate ( true );
2011-04-29 20:47:02 +02:00
Caelestrasz -> GetMotionMaster () -> MoveCharge ( - 8065 , 1530 , 7.61f , 4 );
2010-08-08 22:54:58 +06:00
break ;
case 27 :
2011-04-29 20:47:02 +02:00
Caelestrasz -> CastSpell ( Caelestrasz , 54293 , false );
2010-08-08 22:54:58 +06:00
break ;
case 28 :
2011-04-29 20:47:02 +02:00
DoScriptText ( ANACHRONOS_SAY_2 , me , Fandral );
2010-08-08 22:54:58 +06:00
break ;
case 29 :
2011-04-29 20:47:02 +02:00
Caelestrasz -> GetMotionMaster () -> MoveCharge ( - 8095 , 1530 , 50 , 42 );
2010-08-08 22:54:58 +06:00
DoScriptText ( FANDRAL_SAY_2 , Fandral , me );
break ;
case 30 :
break ;
case 31 :
DoScriptText ( ANACHRONOS_SAY_3 , me , Fandral );
break ;
case 32 :
2010-11-16 01:13:04 +01:00
Caelestrasz -> SetVisible ( false );
2011-04-29 20:47:02 +02:00
Caelestrasz -> GetMotionMaster () -> MoveCharge ( - 8034.535f , 1535.14f , 2.61f , 42 );
Fandral -> GetMotionMaster () -> MoveCharge ( - 8108 , 1529 , 2.77f , 8 );
me -> GetMotionMaster () -> MoveCharge ( - 8113 , 1525 , 2.77f , 8 );
2010-08-08 22:54:58 +06:00
break ; //both run to the gate
case 33 :
DoScriptText ( ANACHRONOS_SAY_4 , me );
2011-04-29 20:47:02 +02:00
Caelestrasz -> GetMotionMaster () -> MoveCharge ( - 8050 , 1473 , 65 , 15 );
2010-08-08 22:54:58 +06:00
break ; //Text: sands will stop
case 34 :
2011-07-01 03:00:39 +02:00
DoCast ( player , 23017 , true ); //Arcane Channeling
2010-08-08 22:54:58 +06:00
break ;
case 35 :
2011-04-29 20:47:02 +02:00
me -> CastSpell ( - 8088 , 1520.43f , 2.67f , 25158 , true );
2010-08-08 22:54:58 +06:00
break ;
case 36 :
2011-07-01 03:00:39 +02:00
DoCast ( player , 25159 , true );
2010-08-08 22:54:58 +06:00
break ;
case 37 :
2011-04-29 20:47:02 +02:00
me -> SummonGameObject ( GO_GATE_OF_AHN_QIRAJ , - 8130 , 1525 , 17.5f , 0 , 0 , 0 , 0 , 0 , 0 );
2010-08-08 22:54:58 +06:00
break ;
case 38 :
2011-07-01 03:00:39 +02:00
DoCast ( player , 25166 , true );
2011-04-29 20:47:02 +02:00
me -> SummonGameObject ( GO_GLYPH_OF_AHN_QIRAJ , - 8130 , 1525 , 17.5f , 0 , 0 , 0 , 0 , 0 , 0 );
2010-08-08 22:54:58 +06:00
break ;
case 39 :
DoScriptText ( ANACHRONOS_SAY_5 , me , Fandral );
break ;
case 40 :
Fandral -> CastSpell ( me , 25167 , true );
break ;
case 41 :
2011-04-29 20:47:02 +02:00
Fandral -> SummonGameObject ( GO_ROOTS_OF_AHN_QIRAJ , - 8130 , 1525 , 17.5f , 0 , 0 , 0 , 0 , 0 , 0 );
2010-08-08 22:54:58 +06:00
DoScriptText ( FANDRAL_SAY_3 , Fandral );
break ;
case 42 :
me -> CastStop ();
DoScriptText ( FANDRAL_EMOTE_1 , Fandral );
break ;
case 43 :
Fandral -> CastStop ();
break ;
case 44 :
DoScriptText ( ANACHRONOS_SAY_6 , me );
break ;
case 45 :
DoScriptText ( ANACHRONOS_SAY_7 , me );
break ;
case 46 :
DoScriptText ( ANACHRONOS_SAY_8 , me );
2011-04-29 20:47:02 +02:00
me -> GetMotionMaster () -> MoveCharge ( - 8110 , 1527 , 2.77f , 4 );
2010-08-08 22:54:58 +06:00
break ;
case 47 :
DoScriptText ( ANACHRONOS_EMOTE_1 , me );
break ;
case 48 :
2011-04-29 20:47:02 +02:00
DoScriptText ( FANDRAL_SAY_4 , Fandral , me );
2010-08-08 22:54:58 +06:00
break ;
case 49 :
2011-04-29 20:47:02 +02:00
DoScriptText ( FANDRAL_SAY_5 , Fandral , me );
2010-08-08 22:54:58 +06:00
break ;
case 50 :
2011-04-29 20:47:02 +02:00
DoScriptText ( FANDRAL_EMOTE_2 , Fandral );
Fandral -> CastSpell ( - 8127 , 1525 , 17.5f , 33806 , true );
2010-08-08 22:54:58 +06:00
break ;
case 51 :
2010-04-19 17:03:10 +02:00
{
2010-08-08 22:54:58 +06:00
uint32 entries [ 4 ] = { 15423 , 15424 , 15414 , 15422 };
for ( uint8 i = 0 ; i < 4 ; ++ i )
2010-04-19 17:03:10 +02:00
{
2011-07-01 03:00:39 +02:00
mob = player -> FindNearestCreature ( entries [ i ], 50 , me );
2010-08-08 22:54:58 +06:00
while ( mob )
{
mob -> RemoveFromWorld ();
2011-07-01 03:00:39 +02:00
mob = player -> FindNearestCreature ( 15423 , 50 , me );
2010-08-08 22:54:58 +06:00
}
2010-04-19 17:03:10 +02:00
}
2010-08-08 22:54:58 +06:00
break ;
2010-04-19 17:03:10 +02:00
}
2010-08-08 22:54:58 +06:00
case 52 :
2011-04-29 20:47:02 +02:00
Fandral -> GetMotionMaster () -> MoveCharge ( - 8028.75f , 1538.795f , 2.61f , 4 );
DoScriptText ( ANACHRONOS_SAY_9 , me , Fandral );
2010-08-08 22:54:58 +06:00
break ;
case 53 :
2011-04-29 20:47:02 +02:00
DoScriptText ( FANDRAL_SAY_6 , Fandral );
2010-08-08 22:54:58 +06:00
break ;
case 54 :
2011-04-29 20:47:02 +02:00
DoScriptText ( ANACHRONOS_EMOTE_2 , me );
2010-08-08 22:54:58 +06:00
break ;
case 55 :
2010-11-16 01:13:04 +01:00
Fandral -> SetVisible ( false );
2010-08-08 22:54:58 +06:00
break ;
case 56 :
DoScriptText ( ANACHRONOS_EMOTE_3 , me );
2011-04-29 20:47:02 +02:00
me -> GetMotionMaster () -> MoveCharge ( - 8116 , 1522 , 3.65f , 4 );
2010-08-08 22:54:58 +06:00
break ;
case 57 :
2011-04-29 20:47:02 +02:00
me -> GetMotionMaster () -> MoveCharge ( - 8116.7f , 1527 , 3.7f , 4 );
2010-08-08 22:54:58 +06:00
break ;
case 58 :
2011-04-29 20:47:02 +02:00
me -> GetMotionMaster () -> MoveCharge ( - 8112.67f , 1529.9f , 2.86f , 4 );
2010-08-08 22:54:58 +06:00
break ;
case 59 :
2011-04-29 20:47:02 +02:00
me -> GetMotionMaster () -> MoveCharge ( - 8117.99f , 1532.24f , 3.94f , 4 );
2010-08-08 22:54:58 +06:00
break ;
case 60 :
2011-07-01 03:00:39 +02:00
if ( player )
DoScriptText ( ANACHRONOS_SAY_10 , me , player );
2011-04-29 20:47:02 +02:00
me -> GetMotionMaster () -> MoveCharge ( - 8113.46f , 1524.16f , 2.89f , 4 );
2010-08-08 22:54:58 +06:00
break ;
case 61 :
2011-04-29 20:47:02 +02:00
me -> GetMotionMaster () -> MoveCharge ( - 8057.1f , 1470.32f , 2.61f , 6 );
2011-07-01 03:00:39 +02:00
if ( player -> IsInRange ( me , 0 , 15 ))
2011-09-29 12:43:05 +02:00
player -> GroupEventHappens ( QUEST_A_PAWN_ON_THE_ETERNAL_BOARD , me );
2010-08-08 22:54:58 +06:00
break ;
case 62 :
me -> SetDisplayId ( 15500 );
break ;
case 63 :
me -> HandleEmoteCommand ( 254 );
2012-02-23 12:32:21 +01:00
me -> SetLevitate ( true );
2010-08-08 22:54:58 +06:00
break ;
case 64 :
2011-04-29 20:47:02 +02:00
me -> GetMotionMaster () -> MoveCharge ( - 8000 , 1400 , 150 , 9 );
2010-08-08 22:54:58 +06:00
break ;
case 65 :
2010-11-16 01:13:04 +01:00
me -> SetVisible ( false );
2010-08-08 22:54:58 +06:00
if ( Creature * AnachronosQuestTrigger = ( Unit :: GetCreature ( * me , AnachronosQuestTriggerGUID )))
{
2011-04-29 20:47:02 +02:00
DoScriptText ( ARYGOS_YELL_1 , me );
2010-08-08 22:54:58 +06:00
AnachronosQuestTrigger -> AI () -> EnterEvadeMode ();
eventEnd = true ;
}
break ;
2010-04-19 17:03:10 +02:00
}
2009-09-19 15:14:05 -07:00
}
2010-08-08 22:54:58 +06:00
++ AnimationCount ;
2009-09-19 15:14:05 -07:00
}
2010-08-08 22:54:58 +06:00
void UpdateAI ( const uint32 diff )
2009-09-19 15:14:05 -07:00
{
2010-08-08 22:54:58 +06:00
if ( AnimationTimer )
{
if ( AnimationTimer <= diff )
HandleAnimation ();
else AnimationTimer -= diff ;
}
if ( AnimationCount < 65 )
me -> CombatStop ();
if ( AnimationCount == 65 || eventEnd )
me -> AI () -> EnterEvadeMode ();
2009-09-19 15:14:05 -07:00
}
2010-08-08 22:54:58 +06:00
};
2009-09-19 15:14:05 -07:00
};
2009-10-17 15:51:44 -07:00
2009-09-19 15:14:05 -07:00
/*######
# mob_qiraj_war_spawn
######*/
2010-08-09 01:52:26 +02:00
class mob_qiraj_war_spawn : public CreatureScript
2009-09-19 15:14:05 -07:00
{
2010-08-08 22:54:58 +06:00
public :
mob_qiraj_war_spawn () : CreatureScript ( "mob_qiraj_war_spawn" ) { }
2010-04-02 15:41:37 +02:00
2010-08-14 10:28:45 +02:00
CreatureAI * GetAI ( Creature * c ) const
2009-09-19 15:14:05 -07:00
{
2010-08-08 22:54:58 +06:00
return new mob_qiraj_war_spawnAI ( c );
2009-09-19 15:14:05 -07:00
}
2009-10-17 15:51:44 -07:00
2010-08-08 22:54:58 +06:00
struct mob_qiraj_war_spawnAI : public ScriptedAI
2009-09-19 15:14:05 -07:00
{
2010-08-08 22:54:58 +06:00
mob_qiraj_war_spawnAI ( Creature * c ) : ScriptedAI ( c ) {}
uint64 MobGUID ;
uint64 PlayerGUID ;
2011-04-29 20:47:02 +02:00
uint32 SpellTimer1 , SpellTimer2 , SpellTimer3 , SpellTimer4 ;
2010-08-08 22:54:58 +06:00
bool Timers ;
bool hasTarget ;
2009-10-17 15:51:44 -07:00
2010-08-08 22:54:58 +06:00
void Reset ()
2009-09-19 15:14:05 -07:00
{
2010-08-08 22:54:58 +06:00
MobGUID = 0 ;
PlayerGUID = 0 ;
Timers = false ;
hasTarget = false ;
2009-09-19 15:14:05 -07:00
}
2010-08-08 22:54:58 +06:00
void EnterCombat ( Unit * /*who*/ ) {}
void JustDied ( Unit * /*slayer*/ );
void UpdateAI ( const uint32 diff )
2009-09-19 15:14:05 -07:00
{
2011-07-02 23:16:45 +02:00
Unit * target = NULL ;
2011-07-01 03:00:39 +02:00
//Player* player = me->GetPlayer(PlayerGUID);
2010-08-08 22:54:58 +06:00
if ( ! Timers )
2009-09-19 15:14:05 -07:00
{
2010-08-08 22:54:58 +06:00
if ( me -> GetEntry () == 15424 || me -> GetEntry () == 15422 || me -> GetEntry () == 15414 ) //all but Kaldorei Soldiers
{
SpellTimer1 = SpawnCast [ 1 ]. Timer1 ;
SpellTimer2 = SpawnCast [ 2 ]. Timer1 ;
SpellTimer3 = SpawnCast [ 3 ]. Timer1 ;
}
if ( me -> GetEntry () == 15423 || me -> GetEntry () == 15424 || me -> GetEntry () == 15422 || me -> GetEntry () == 15414 )
SpellTimer4 = SpawnCast [ 0 ]. Timer1 ;
Timers = true ;
}
if ( me -> GetEntry () == 15424 || me -> GetEntry () == 15422 || me -> GetEntry () == 15414 )
2009-09-19 15:14:05 -07:00
{
2010-08-08 22:54:58 +06:00
if ( SpellTimer1 <= diff )
{
DoCast ( me , SpawnCast [ 1 ]. SpellId );
DoCast ( me , 24319 );
SpellTimer1 = SpawnCast [ 1 ]. Timer2 ;
} else SpellTimer1 -= diff ;
if ( SpellTimer2 <= diff )
{
DoCast ( me , SpawnCast [ 2 ]. SpellId );
SpellTimer2 = SpawnCast [ 2 ]. Timer2 ;
} else SpellTimer2 -= diff ;
if ( SpellTimer3 <= diff )
{
DoCast ( me , SpawnCast [ 3 ]. SpellId );
SpellTimer3 = SpawnCast [ 3 ]. Timer2 ;
} else SpellTimer3 -= diff ;
}
if ( me -> GetEntry () == 15423 || me -> GetEntry () == 15424 || me -> GetEntry () == 15422 || me -> GetEntry () == 15414 )
2009-09-19 15:14:05 -07:00
{
2010-08-08 22:54:58 +06:00
if ( SpellTimer4 <= diff )
{
me -> RemoveAllAttackers ();
me -> AttackStop ();
DoCast ( me , 15533 );
SpellTimer4 = SpawnCast [ 0 ]. Timer2 ;
} else SpellTimer4 -= diff ;
}
if ( ! hasTarget )
2009-09-19 15:14:05 -07:00
{
2010-08-08 22:54:58 +06:00
if ( me -> GetEntry () == 15424 || me -> GetEntry () == 15422 || me -> GetEntry () == 15414 )
2011-07-02 23:16:45 +02:00
target = me -> FindNearestCreature ( 15423 , 20 , true );
2010-08-08 22:54:58 +06:00
if ( me -> GetEntry () == 15423 )
{
2011-04-29 20:47:02 +02:00
uint8 tar = urand ( 0 , 2 );
2010-08-08 22:54:58 +06:00
if ( tar == 0 )
2011-07-02 23:16:45 +02:00
target = me -> FindNearestCreature ( 15422 , 20 , true );
2010-08-08 22:54:58 +06:00
else if ( tar == 1 )
2011-07-02 23:16:45 +02:00
target = me -> FindNearestCreature ( 15424 , 20 , true );
2010-08-08 22:54:58 +06:00
else if ( tar == 2 )
2011-07-02 23:16:45 +02:00
target = me -> FindNearestCreature ( 15414 , 20 , true );
2010-08-08 22:54:58 +06:00
}
hasTarget = true ;
2011-07-02 23:16:45 +02:00
if ( target )
me -> AI () -> AttackStart ( target );
2010-08-08 22:54:58 +06:00
}
2011-04-29 20:47:02 +02:00
if ( ! ( me -> FindNearestCreature ( 15379 , 60 )))
2010-08-08 22:54:58 +06:00
DoCast ( me , 33652 );
if ( ! UpdateVictim ())
2009-09-19 15:14:05 -07:00
{
2010-08-08 22:54:58 +06:00
hasTarget = false ;
return ;
2009-09-19 15:14:05 -07:00
}
2009-10-17 15:51:44 -07:00
2010-08-08 22:54:58 +06:00
DoMeleeAttackIfReady ();
2009-09-19 15:14:05 -07:00
}
2010-08-08 22:54:58 +06:00
};
2009-10-17 15:51:44 -07:00
2009-09-19 15:14:05 -07:00
};
2009-10-17 15:51:44 -07:00
2009-09-19 15:14:05 -07:00
/*#####
# npc_anachronos_quest_trigger
#####*/
2010-08-09 01:52:26 +02:00
class npc_anachronos_quest_trigger : public CreatureScript
2009-09-19 15:14:05 -07:00
{
2010-08-08 22:54:58 +06:00
public :
npc_anachronos_quest_trigger () : CreatureScript ( "npc_anachronos_quest_trigger" ) { }
2009-10-17 15:51:44 -07:00
2010-08-14 10:28:45 +02:00
CreatureAI * GetAI ( Creature * c ) const
2010-08-08 22:54:58 +06:00
{
return new npc_anachronos_quest_triggerAI ( c );
}
2009-10-17 15:51:44 -07:00
2010-08-08 22:54:58 +06:00
struct npc_anachronos_quest_triggerAI : public ScriptedAI
{
npc_anachronos_quest_triggerAI ( Creature * c ) : ScriptedAI ( c ) {}
2009-10-17 15:51:44 -07:00
2010-08-08 22:54:58 +06:00
uint64 PlayerGUID ;
2009-10-17 15:51:44 -07:00
2010-08-08 22:54:58 +06:00
uint32 WaveTimer ;
uint32 AnnounceTimer ;
2009-10-17 15:51:44 -07:00
2010-08-08 22:54:58 +06:00
int8 LiveCount ;
uint8 WaveCount ;
bool EventStarted ;
bool Announced ;
bool Failed ;
2009-10-17 15:51:44 -07:00
2010-08-08 22:54:58 +06:00
void Reset ()
{
PlayerGUID = 0 ;
2009-10-17 15:51:44 -07:00
2010-08-08 22:54:58 +06:00
WaveTimer = 2000 ;
AnnounceTimer = 1000 ;
LiveCount = 0 ;
WaveCount = 0 ;
2009-10-17 15:51:44 -07:00
2010-08-08 22:54:58 +06:00
EventStarted = false ;
Announced = false ;
Failed = false ;
2009-10-17 15:51:44 -07:00
2010-11-16 01:13:04 +01:00
me -> SetVisible ( false );
2010-08-08 22:54:58 +06:00
}
void SummonNextWave ()
2009-09-19 15:14:05 -07:00
{
2010-08-08 22:54:58 +06:00
//uint8 count = WavesInfo[WaveCount].SpawnCount;
uint8 locIndex = WavesInfo [ WaveCount ]. UsedSpawnPoint ;
//uint8 KaldoreiSoldierCount = 0;
//uint8 AnubisathConquerorCount = 0;
//uint8 QirajiWaspCount = 0;
for ( uint8 i = 0 ; i < 67 ; ++ i )
2009-09-19 15:14:05 -07:00
{
2010-12-20 12:03:23 +01:00
if ( Creature * spawn = me -> SummonCreature ( WavesInfo [ WaveCount ]. CreatureId , SpawnLocation [ locIndex + i ], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN , WavesInfo [ WaveCount ]. DespTimer ))
2009-09-20 13:01:06 +02:00
{
2010-12-20 12:03:23 +01:00
spawn -> LoadCreaturesAddon ();
if ( spawn -> GetEntry () == 15423 )
spawn -> SetUInt32Value ( UNIT_FIELD_DISPLAYID , 15427 + rand () % 4 );
2010-08-08 22:54:58 +06:00
if ( i >= 30 ) WaveCount = 1 ;
if ( i >= 33 ) WaveCount = 2 ;
if ( i >= 45 ) WaveCount = 3 ;
if ( i >= 51 ) WaveCount = 4 ;
if ( WaveCount < 5 ) //1-4 Wave
{
2010-12-20 12:03:23 +01:00
mob_qiraj_war_spawn :: mob_qiraj_war_spawnAI * spawnAI = CAST_AI ( mob_qiraj_war_spawn :: mob_qiraj_war_spawnAI , spawn -> AI ());
spawnAI -> MobGUID = me -> GetGUID ();
spawnAI -> PlayerGUID = PlayerGUID ;
2010-08-08 22:54:58 +06:00
}
2009-09-20 13:01:06 +02:00
}
2009-09-19 15:14:05 -07:00
}
2010-08-08 22:54:58 +06:00
WaveTimer = WavesInfo [ WaveCount ]. SpawnTimer ;
AnnounceTimer = WavesInfo [ WaveCount ]. YellTimer ;
2009-09-19 15:14:05 -07:00
}
2009-10-17 15:51:44 -07:00
2010-08-08 22:54:58 +06:00
void CheckEventFail ()
{
2011-07-02 22:52:42 +02:00
Player * player = Unit :: GetPlayer ( * me , PlayerGUID );
2009-10-17 15:51:44 -07:00
2011-07-02 22:52:42 +02:00
if ( ! player )
2010-08-08 22:54:58 +06:00
return ;
2009-10-17 15:51:44 -07:00
2011-09-15 14:08:17 +02:00
if ( Group * EventGroup = player -> GetGroup ())
2010-08-08 22:54:58 +06:00
{
Player * GroupMember ;
2009-10-17 15:51:44 -07:00
2010-08-08 22:54:58 +06:00
uint8 GroupMemberCount = 0 ;
uint8 DeadMemberCount = 0 ;
uint8 FailedMemberCount = 0 ;
2009-10-17 15:51:44 -07:00
2010-08-08 22:54:58 +06:00
const Group :: MemberSlotList members = EventGroup -> GetMemberSlots ();
2009-10-17 15:51:44 -07:00
2010-08-08 22:54:58 +06:00
for ( Group :: member_citerator itr = members . begin (); itr != members . end (); ++ itr )
2009-09-19 15:14:05 -07:00
{
2010-08-08 22:54:58 +06:00
GroupMember = ( Unit :: GetPlayer ( * me , itr -> guid ));
if ( ! GroupMember )
continue ;
if ( ! GroupMember -> IsWithinDistInMap ( me , EVENT_AREA_RADIUS ) && GroupMember -> GetQuestStatus ( QUEST_A_PAWN_ON_THE_ETERNAL_BOARD ) == QUEST_STATUS_INCOMPLETE )
{
GroupMember -> FailQuest ( QUEST_A_PAWN_ON_THE_ETERNAL_BOARD );
++ FailedMemberCount ;
}
++ GroupMemberCount ;
if ( GroupMember -> isDead ())
++ DeadMemberCount ;
2009-09-19 15:14:05 -07:00
}
2009-10-17 15:51:44 -07:00
2011-07-02 22:52:42 +02:00
if ( GroupMemberCount == FailedMemberCount || ! player -> IsWithinDistInMap ( me , EVENT_AREA_RADIUS ))
2010-08-08 22:54:58 +06:00
Failed = true ; //only so event can restart
2009-09-19 15:14:05 -07:00
}
}
2009-10-17 15:51:44 -07:00
2010-08-08 22:54:58 +06:00
void LiveCounter ()
{
-- LiveCount ;
if ( ! LiveCount )
Announced = false ;
}
2009-10-17 15:51:44 -07:00
2010-08-08 22:54:58 +06:00
void UpdateAI ( const uint32 diff )
2009-09-19 15:14:05 -07:00
{
2010-08-08 22:54:58 +06:00
if ( ! PlayerGUID || ! EventStarted )
return ;
if ( WaveCount < 4 )
2009-09-19 15:14:05 -07:00
{
2010-08-08 22:54:58 +06:00
if ( ! Announced && AnnounceTimer <= diff )
{
DoScriptText ( WavesInfo [ WaveCount ]. WaveTextId , me );
Announced = true ;
} else AnnounceTimer -= diff ;
2009-10-17 15:51:44 -07:00
2010-08-08 22:54:58 +06:00
if ( WaveTimer <= diff )
SummonNextWave ();
else WaveTimer -= diff ;
}
CheckEventFail ();
if ( WaveCount == 4 || Failed )
EnterEvadeMode ();
};
2009-11-02 17:34:26 +01:00
};
2010-08-08 22:54:58 +06:00
2009-09-19 15:14:05 -07:00
};
2010-08-08 22:54:58 +06:00
void mob_qiraj_war_spawn :: mob_qiraj_war_spawnAI :: JustDied ( Unit * /*slayer*/ )
2009-09-19 15:14:05 -07:00
{
2010-04-14 23:07:41 +02:00
me -> RemoveCorpse ();
if ( Creature * Mob = ( Unit :: GetCreature ( * me , MobGUID )))
2010-08-08 22:54:58 +06:00
CAST_AI ( npc_anachronos_quest_trigger :: npc_anachronos_quest_triggerAI , Mob -> AI ()) -> LiveCounter ();
2009-10-17 15:51:44 -07:00
2009-09-19 15:14:05 -07:00
};
2010-08-08 22:54:58 +06:00
2009-09-19 15:14:05 -07:00
/*#####
# go_crystalline_tear
######*/
2010-08-09 01:52:26 +02:00
class go_crystalline_tear : public GameObjectScript
2009-09-19 15:14:05 -07:00
{
2010-08-08 22:54:58 +06:00
public :
go_crystalline_tear () : GameObjectScript ( "go_crystalline_tear" ) { }
2009-10-17 15:51:44 -07:00
2011-07-01 03:00:39 +02:00
bool OnQuestAccept ( Player * player , GameObject * go , Quest const * quest )
2010-08-08 22:54:58 +06:00
{
if ( quest -> GetQuestId () == QUEST_A_PAWN_ON_THE_ETERNAL_BOARD )
2009-09-19 15:14:05 -07:00
{
2009-10-17 15:51:44 -07:00
2011-07-01 03:00:39 +02:00
if ( Unit * Anachronos_Quest_Trigger = go -> FindNearestCreature ( 15454 , 100 , player ))
2009-09-20 15:33:34 +02:00
{
2009-10-17 15:51:44 -07:00
2011-06-30 14:24:56 +02:00
Unit * Merithra = Anachronos_Quest_Trigger -> SummonCreature ( 15378 , - 8034.535f , 1535.14f , 2.61f , 0 , TEMPSUMMON_TIMED_OR_DEAD_DESPAWN , 220000 );
Unit * Caelestrasz = Anachronos_Quest_Trigger -> SummonCreature ( 15379 , - 8032.767f , 1533.148f , 2.61f , 1.5f , TEMPSUMMON_TIMED_OR_DEAD_DESPAWN , 220000 );
Unit * Arygos = Anachronos_Quest_Trigger -> SummonCreature ( 15380 , - 8034.52f , 1537.843f , 2.61f , 5.7f , TEMPSUMMON_TIMED_OR_DEAD_DESPAWN , 220000 );
/* Unit* Fandral = */ Anachronos_Quest_Trigger -> SummonCreature ( 15382 , - 8028.462f , 1535.843f , 2.61f , 3.141592f , TEMPSUMMON_TIMED_OR_DEAD_DESPAWN , 220000 );
Creature * Anachronos = Anachronos_Quest_Trigger -> SummonCreature ( 15381 , - 8028.75f , 1538.795f , 2.61f , 4 , TEMPSUMMON_TIMED_OR_DEAD_DESPAWN , 220000 );
2009-10-17 15:51:44 -07:00
2010-08-08 22:54:58 +06:00
if ( Merithra )
{
Merithra -> SetUInt32Value ( UNIT_NPC_FLAGS , 0 );
2011-04-29 20:47:02 +02:00
Merithra -> SetUInt32Value ( UNIT_FIELD_BYTES_1 , 0 );
Merithra -> SetUInt32Value ( UNIT_FIELD_DISPLAYID , 15420 );
2010-08-08 22:54:58 +06:00
Merithra -> setFaction ( 35 );
}
2009-10-17 15:51:44 -07:00
2010-08-08 22:54:58 +06:00
if ( Caelestrasz )
{
Caelestrasz -> SetUInt32Value ( UNIT_NPC_FLAGS , 0 );
2011-04-29 20:47:02 +02:00
Caelestrasz -> SetUInt32Value ( UNIT_FIELD_BYTES_1 , 0 );
Caelestrasz -> SetUInt32Value ( UNIT_FIELD_DISPLAYID , 15419 );
2010-08-08 22:54:58 +06:00
Caelestrasz -> setFaction ( 35 );
}
if ( Arygos )
{
Arygos -> SetUInt32Value ( UNIT_NPC_FLAGS , 0 );
2011-04-29 20:47:02 +02:00
Arygos -> SetUInt32Value ( UNIT_FIELD_BYTES_1 , 0 );
Arygos -> SetUInt32Value ( UNIT_FIELD_DISPLAYID , 15418 );
2010-08-08 22:54:58 +06:00
Arygos -> setFaction ( 35 );
}
if ( Anachronos )
{
2011-07-01 03:00:39 +02:00
CAST_AI ( npc_anachronos_the_ancient :: npc_anachronos_the_ancientAI , Anachronos -> AI ()) -> PlayerGUID = player -> GetGUID ();
2010-08-08 22:54:58 +06:00
CAST_AI ( npc_anachronos_quest_trigger :: npc_anachronos_quest_triggerAI , CAST_CRE ( Anachronos_Quest_Trigger ) -> AI ()) -> Failed = false ;
2011-07-01 03:00:39 +02:00
CAST_AI ( npc_anachronos_quest_trigger :: npc_anachronos_quest_triggerAI , CAST_CRE ( Anachronos_Quest_Trigger ) -> AI ()) -> PlayerGUID = player -> GetGUID ();
2010-08-08 22:54:58 +06:00
CAST_AI ( npc_anachronos_quest_trigger :: npc_anachronos_quest_triggerAI , CAST_CRE ( Anachronos_Quest_Trigger ) -> AI ()) -> EventStarted = true ;
CAST_AI ( npc_anachronos_quest_trigger :: npc_anachronos_quest_triggerAI , CAST_CRE ( Anachronos_Quest_Trigger ) -> AI ()) -> Announced = true ;
}
2009-09-20 15:33:34 +02:00
}
2009-09-19 15:14:05 -07:00
}
2010-08-08 22:54:58 +06:00
return true ;
2009-09-19 15:14:05 -07:00
}
2009-10-17 15:51:44 -07:00
2010-08-08 22:54:58 +06:00
};
2009-10-17 15:51:44 -07:00
2011-07-05 22:07:40 +01:00
/*###
## go_wind_stone
###*/
enum WSSpells
{
SPELL_PUNISHMENT = 24803 ,
SPELL_SPAWN_IN = 25035 ,
AURA_TWILIGHT_SET = 24746 ,
AURA_MEDALLION = 24748 ,
AURA_RING = 24782 ,
SPELL_TEMPLAR_RANDOM = 24745 ,
SPELL_TEMPLAR_FIRE = 24747 ,
SPELL_TEMPLAR_AIR = 24757 ,
SPELL_TEMPLAR_EARTH = 24759 ,
SPELL_TEMPLAR_WATER = 24761 ,
SPELL_DUKE_RANDOM = 24762 ,
SPELL_DUKE_FIRE = 24766 ,
SPELL_DUKE_AIR = 24769 ,
SPELL_DUKE_EARTH = 24771 ,
SPELL_DUKE_WATER = 24773 ,
SPELL_ROYAL_RANDOM = 24785 ,
SPELL_ROYAL_FIRE = 24787 ,
SPELL_ROYAL_AIR = 24791 ,
SPELL_ROYAL_EARTH = 24792 ,
SPELL_ROYAL_WATER = 24793
};
enum WSGossip
{
GOSSIPID_LESSER_WS = 6540 ,
GOSSIPID_WS = 6542 ,
GOSSIPID_GREATER_WS = 6543
};
enum WSCreatures
{
NPC_TEMPLAR_FIRE = 15209 ,
NPC_TEMPLAR_WATER = 15211 ,
NPC_TEMPLAR_AIR = 15212 ,
NPC_TEMPLAR_EARTH = 15307 ,
2011-09-29 12:43:05 +02:00
2011-07-05 22:07:40 +01:00
NPC_DUKE_FIRE = 15206 ,
NPC_DUKE_WATER = 15207 ,
NPC_DUKE_EARTH = 15208 ,
NPC_DUKE_AIR = 15220 ,
2011-09-29 12:43:05 +02:00
2011-07-05 22:07:40 +01:00
NPC_ROYAL_FIRE = 15203 ,
NPC_ROYAL_AIR = 15204 ,
NPC_ROYAL_EARTH = 15205 ,
NPC_ROYAL_WATER = 15305
};
enum WSItems
{
ITEM_TEMPLAR_FIRE = 20416 ,
ITEM_TEMPLAR_EARTH = 20419 ,
ITEM_TEMPLAR_WATER = 20420 ,
ITEM_TEMPLAR_AIR = 20418 ,
ITEM_DUKE_FIRE = 20432 ,
ITEM_DUKE_EARTH = 20435 ,
ITEM_DUKE_WATER = 20436 ,
ITEM_DUKE_AIR = 20433 ,
ITEM_ROYAL_FIRE = 20447 ,
ITEM_ROYAL_EARTH = 20449 ,
ITEM_ROYAL_WATER = 20450 ,
ITEM_ROYAL_AIR = 20448 ,
};
enum WS
{
TEMPLAR = 0 ,
DUKE = 1 ,
ROYAL = 2 ,
FIRE = 0x1 ,
WATER = 0x2 ,
EARTH = 0x4 ,
AIR = 0x8
};
enum WSTexts
{
SAY_TEMPLAR_AGGRO = 0 ,
SAY_DUKE_AGGRO = 0 ,
YELL_ROYAL_AGGRO = 0
};
#define GOSSIP_TEMPLAR_RANDOM "I am no cultist, you monster! Come to me and face your destruction!"
#define GOSSIP_TEMPLAR_FIRE "Crimson Templar! I hold your signet! Heed my call!"
#define GOSSIP_TEMPLAR_EARTH "Earthen Templar! I hold your signet! Heed my call!"
#define GOSSIP_TEMPLAR_AIR "Hoary Templar! I hold your signet! Heed my call!"
#define GOSSIP_TEMPLAR_WATER "Azure Templar! I hold your signet! Heed my call!"
#define GOSSIP_DUKE_RANDOM "You will listen to this, vile duke! I am not your Twilight's Hammer lapdog! I am here to challenge you! Come! Come, and meet your death..."
#define GOSSIP_DUKE_FIRE "Duke of Cynders! I hold your signet! Heed my call!"
#define GOSSIP_DUKE_EARTH "The Duke of Shards! I hold your signet! Heed my call!"
#define GOSSIP_DUKE_AIR "The Duke of Zephyrs! I hold your signet! Heed my call!"
#define GOSSIP_DUKE_WATER "The Duke of Fathoms! I hold your signet! Heed my call!"
#define GOSSIP_ROYAL_RANDOM "The day of the judgement has come, fiend! I challenge you to battle!"
#define GOSSIP_ROYAL_FIRE "Prince Skaldrenox! I hold your signet! Heed my call!"
#define GOSSIP_ROYAL_EARTH "Baron Kazum! I hold your signet! Heed my call!"
#define GOSSIP_ROYAL_AIR "High Marshal Whirlaxis! I hold your signet! Heed my call!"
#define GOSSIP_ROYAL_WATER "Lord Skwol! I hold your signet! Heed my call!"
class go_wind_stone : public GameObjectScript
{
public :
go_wind_stone () : GameObjectScript ( "go_wind_stone" ) { }
private :
uint8 GetPlayerRank ( Player * player ) // For random summoning
{
bool setAura = player -> HasAura ( AURA_TWILIGHT_SET );
bool medallionAura = player -> HasAura ( AURA_MEDALLION );
bool ringAura = player -> HasAura ( AURA_RING );
if ( setAura && medallionAura && ringAura )
return 3 ;
else if ( setAura && medallionAura )
return 2 ;
else if ( setAura )
return 1 ;
else
return 0 ;
}
uint8 GetItems ( Player * player , WS type )
{
uint8 result = 0x0 ;
switch ( type )
{
case TEMPLAR :
{
if ( player -> HasItemCount ( ITEM_TEMPLAR_FIRE , 1 ))
result |= FIRE ;
if ( player -> HasItemCount ( ITEM_TEMPLAR_WATER , 1 ))
result |= WATER ;
if ( player -> HasItemCount ( ITEM_TEMPLAR_EARTH , 1 ))
result |= EARTH ;
if ( player -> HasItemCount ( ITEM_TEMPLAR_AIR , 1 ))
result |= AIR ;
break ;
}
case DUKE :
{
if ( player -> HasItemCount ( ITEM_DUKE_FIRE , 1 ))
result |= FIRE ;
if ( player -> HasItemCount ( ITEM_DUKE_WATER , 1 ))
result |= WATER ;
if ( player -> HasItemCount ( ITEM_DUKE_EARTH , 1 ))
result |= EARTH ;
if ( player -> HasItemCount ( ITEM_DUKE_AIR , 1 ))
result |= AIR ;
break ;
}
case ROYAL :
{
if ( player -> HasItemCount ( ITEM_ROYAL_FIRE , 1 ))
result |= FIRE ;
if ( player -> HasItemCount ( ITEM_ROYAL_WATER , 1 ))
result |= WATER ;
if ( player -> HasItemCount ( ITEM_ROYAL_EARTH , 1 ))
result |= EARTH ;
if ( player -> HasItemCount ( ITEM_ROYAL_AIR , 1 ))
result |= AIR ;
break ;
}
default :
break ;
}
return result ;
}
void SummonNPC ( GameObject * go , Player * player , uint32 npc , uint32 spell )
{
go -> CastSpell ( player , spell );
TempSummon * summons = go -> SummonCreature ( npc , go -> GetPositionX (), go -> GetPositionY (), go -> GetPositionZ (), player -> GetOrientation () - M_PI , TEMPSUMMON_TIMED_OR_DEAD_DESPAWN , 10 * 60 * 1000 );
summons -> CastSpell ( summons , SPELL_SPAWN_IN , false );
switch ( summons -> GetEntry ())
{
case NPC_TEMPLAR_FIRE :
case NPC_TEMPLAR_WATER :
case NPC_TEMPLAR_AIR :
case NPC_TEMPLAR_EARTH :
summons -> AI () -> Talk ( SAY_TEMPLAR_AGGRO );
break ;
case NPC_DUKE_FIRE :
case NPC_DUKE_WATER :
case NPC_DUKE_EARTH :
case NPC_DUKE_AIR :
summons -> AI () -> Talk ( SAY_DUKE_AGGRO );
break ;
case NPC_ROYAL_FIRE :
case NPC_ROYAL_AIR :
case NPC_ROYAL_EARTH :
case NPC_ROYAL_WATER :
summons -> AI () -> Talk ( YELL_ROYAL_AGGRO );
break ;
}
summons -> RemoveFlag ( UNIT_FIELD_FLAGS , UNIT_FLAG_NON_ATTACKABLE );
summons -> SendMeleeAttackStart ( player );
summons -> CombatStart ( player );
}
public :
bool OnGossipHello ( Player * player , GameObject * go )
{
uint8 rank = GetPlayerRank ( player );
uint32 gossipId = go -> GetGOInfo () -> GetGossipMenuId ();
switch ( gossipId )
{
case GOSSIPID_LESSER_WS :
{
if ( rank >= 1 ) // 1 or 2 or 3
player -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_TEMPLAR_RANDOM , GOSSIP_SENDER_MAIN , GOSSIP_ACTION_INFO_DEF + 1 );
else
{
go -> CastSpell ( player , SPELL_PUNISHMENT );
break ;
}
uint8 item = GetItems ( player , TEMPLAR );
if ( item & FIRE )
player -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_TEMPLAR_FIRE , GOSSIP_SENDER_MAIN , GOSSIP_ACTION_INFO_DEF + 2 );
if ( item & WATER )
player -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_TEMPLAR_WATER , GOSSIP_SENDER_MAIN , GOSSIP_ACTION_INFO_DEF + 3 );
if ( item & EARTH )
player -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_TEMPLAR_EARTH , GOSSIP_SENDER_MAIN , GOSSIP_ACTION_INFO_DEF + 4 );
if ( item & AIR )
player -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_TEMPLAR_AIR , GOSSIP_SENDER_MAIN , GOSSIP_ACTION_INFO_DEF + 5 );
2011-07-06 18:17:44 +01:00
break ;
2011-07-05 22:07:40 +01:00
}
case GOSSIPID_WS :
{
if ( rank >= 2 ) // 2 or 3
player -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_DUKE_RANDOM , GOSSIP_SENDER_MAIN , GOSSIP_ACTION_INFO_DEF + 6 );
else
{
go -> CastSpell ( player , SPELL_PUNISHMENT );
break ;
}
uint8 item = GetItems ( player , DUKE );
if ( item & FIRE )
player -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_DUKE_FIRE , GOSSIP_SENDER_MAIN , GOSSIP_ACTION_INFO_DEF + 7 );
if ( item & WATER )
player -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_DUKE_WATER , GOSSIP_SENDER_MAIN , GOSSIP_ACTION_INFO_DEF + 8 );
if ( item & EARTH )
player -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_DUKE_EARTH , GOSSIP_SENDER_MAIN , GOSSIP_ACTION_INFO_DEF + 9 );
if ( item & AIR )
player -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_DUKE_AIR , GOSSIP_SENDER_MAIN , GOSSIP_ACTION_INFO_DEF + 10 );
break ;
}
case GOSSIPID_GREATER_WS :
{
if ( rank == 3 ) // 3
player -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_ROYAL_RANDOM , GOSSIP_SENDER_MAIN , GOSSIP_ACTION_INFO_DEF + 11 );
else
{
go -> CastSpell ( player , SPELL_PUNISHMENT );
break ;
}
uint8 item = GetItems ( player , ROYAL );
if ( item & FIRE )
player -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_ROYAL_FIRE , GOSSIP_SENDER_MAIN , GOSSIP_ACTION_INFO_DEF + 12 );
if ( item & WATER )
player -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_ROYAL_WATER , GOSSIP_SENDER_MAIN , GOSSIP_ACTION_INFO_DEF + 13 );
if ( item & EARTH )
player -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_ROYAL_EARTH , GOSSIP_SENDER_MAIN , GOSSIP_ACTION_INFO_DEF + 14 );
if ( item & AIR )
player -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_ROYAL_AIR , GOSSIP_SENDER_MAIN , GOSSIP_ACTION_INFO_DEF + 15 );
break ;
}
default :
break ;
}
2012-02-15 22:12:15 +01:00
player -> SEND_GOSSIP_MENU ( player -> GetGossipTextId ( gossipId , go ), go -> GetGUID ());
2011-07-05 22:07:40 +01:00
return true ;
}
bool OnGossipSelect ( Player * player , GameObject * go , uint32 /*sender*/ , uint32 action )
{
player -> PlayerTalkClass -> ClearMenus ();
player -> PlayerTalkClass -> SendCloseGossip ();
switch ( action )
{
case GOSSIP_ACTION_INFO_DEF + 1 :
SummonNPC ( go , player , RAND ( NPC_TEMPLAR_WATER , NPC_TEMPLAR_FIRE , NPC_TEMPLAR_EARTH , NPC_TEMPLAR_AIR ), SPELL_TEMPLAR_RANDOM );
break ;
case GOSSIP_ACTION_INFO_DEF + 2 :
SummonNPC ( go , player , NPC_TEMPLAR_FIRE , SPELL_TEMPLAR_FIRE );
break ;
case GOSSIP_ACTION_INFO_DEF + 3 :
SummonNPC ( go , player , NPC_TEMPLAR_WATER , SPELL_TEMPLAR_WATER );
break ;
case GOSSIP_ACTION_INFO_DEF + 4 :
SummonNPC ( go , player , NPC_TEMPLAR_EARTH , SPELL_TEMPLAR_EARTH );
break ;
case GOSSIP_ACTION_INFO_DEF + 5 :
SummonNPC ( go , player , NPC_TEMPLAR_AIR , SPELL_TEMPLAR_AIR );
break ;
case GOSSIP_ACTION_INFO_DEF + 6 :
SummonNPC ( go , player , RAND ( NPC_DUKE_FIRE , NPC_DUKE_WATER , NPC_DUKE_EARTH , NPC_DUKE_AIR ), SPELL_DUKE_RANDOM );
break ;
case GOSSIP_ACTION_INFO_DEF + 7 :
SummonNPC ( go , player , NPC_DUKE_FIRE , SPELL_DUKE_FIRE );
break ;
case GOSSIP_ACTION_INFO_DEF + 8 :
SummonNPC ( go , player , NPC_DUKE_WATER , SPELL_DUKE_WATER );
break ;
case GOSSIP_ACTION_INFO_DEF + 9 :
SummonNPC ( go , player , NPC_DUKE_EARTH , SPELL_DUKE_EARTH );
break ;
case GOSSIP_ACTION_INFO_DEF + 10 :
SummonNPC ( go , player , NPC_DUKE_AIR , SPELL_DUKE_AIR );
break ;
case GOSSIP_ACTION_INFO_DEF + 11 :
SummonNPC ( go , player , RAND ( NPC_ROYAL_FIRE , NPC_ROYAL_AIR , NPC_ROYAL_EARTH , NPC_ROYAL_WATER ), SPELL_ROYAL_RANDOM );
break ;
case GOSSIP_ACTION_INFO_DEF + 12 :
SummonNPC ( go , player , NPC_ROYAL_FIRE , SPELL_ROYAL_FIRE );
break ;
case GOSSIP_ACTION_INFO_DEF + 13 :
SummonNPC ( go , player , NPC_ROYAL_WATER , SPELL_ROYAL_WATER );
break ;
case GOSSIP_ACTION_INFO_DEF + 14 :
SummonNPC ( go , player , NPC_ROYAL_EARTH , SPELL_ROYAL_EARTH );
break ;
case GOSSIP_ACTION_INFO_DEF + 15 :
SummonNPC ( go , player , NPC_ROYAL_AIR , SPELL_ROYAL_AIR );
break ;
default :
break ;
}
return true ;
}
};
2008-10-21 13:19:26 -05:00
void AddSC_silithus ()
{
2010-08-08 22:54:58 +06:00
new go_crystalline_tear ();
new npc_anachronos_quest_trigger ();
new npc_anachronos_the_ancient ();
new mob_qiraj_war_spawn ();
new npc_highlord_demitrian ();
new npcs_rutgar_and_frankal ();
2011-07-05 22:07:40 +01:00
new go_wind_stone ();
2008-10-21 13:19:26 -05:00
}