Files
TCPlayerbotCore/src/server/scripts/Outland/netherstorm.cpp
T

928 lines
32 KiB
C++
Raw Normal View History

/*
* Copyright (C) 2008-2010 TrinityCore <http://www.trinitycore.org/>
* 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, see <http://www.gnu.org/licenses/>.
*/
2009-10-17 15:51:44 -07:00
/* ScriptData
SDName: Netherstorm
SD%Complete: 75
2009-01-14 19:33:55 +01:00
SDComment: Quest support: 10337, 10438, 10652 (special flight paths), 10299,10321,10322,10323,10329,10330,10338,10365(Shutting Down Manaforge), 10198
SDCategory: Netherstorm
EndScriptData */
2009-10-17 15:51:44 -07:00
/* ContentData
npc_manaforge_control_console
go_manaforge_control_console
2008-12-20 19:10:00 +01:00
npc_commander_dawnforge
2009-01-14 19:33:55 +01:00
npc_bessy
EndContentData */
2009-10-17 15:51:44 -07:00
#include "ScriptPCH.h"
2010-01-19 11:36:05 +01:00
#include "ScriptedEscortAI.h"
2009-10-17 15:51:44 -07:00
/*######
## npc_manaforge_control_console
######*/
2009-10-17 15:51:44 -07:00
//used by 20209,20417,20418,20440, signed for 20209
#define EMOTE_START -1000211
#define EMOTE_60 -1000212
#define EMOTE_30 -1000213
#define EMOTE_10 -1000214
#define EMOTE_COMPLETE -1000215
#define EMOTE_ABORT -1000216
2009-10-17 15:51:44 -07:00
#define ENTRY_BNAAR_C_CONSOLE 20209
#define ENTRY_CORUU_C_CONSOLE 20417
#define ENTRY_DURO_C_CONSOLE 20418
#define ENTRY_ARA_C_CONSOLE 20440
2009-10-17 15:51:44 -07:00
#define ENTRY_SUNFURY_TECH 20218
#define ENTRY_SUNFURY_PROT 20436
2009-10-17 15:51:44 -07:00
#define ENTRY_ARA_TECH 20438
#define ENTRY_ARA_ENGI 20439
#define ENTRY_ARA_GORKLONN 20460
2009-10-17 15:51:44 -07:00
#define SPELL_DISABLE_VISUAL 35031
#define SPELL_INTERRUPT_1 35016 //ACID mobs should cast this
#define SPELL_INTERRUPT_2 35176 //ACID mobs should cast this (Manaforge Ara-version)
2009-10-17 15:51:44 -07:00
2010-02-05 00:31:28 +01:00
struct npc_manaforge_control_consoleAI : public ScriptedAI
{
npc_manaforge_control_consoleAI(Creature *c) : ScriptedAI(c) {}
2009-10-17 15:51:44 -07:00
uint32 Event_Timer;
uint32 Wave_Timer;
uint32 Phase;
bool Wave;
uint64 someplayer;
uint64 goConsole;
Creature* add;
2009-10-17 15:51:44 -07:00
void Reset()
{
Event_Timer = 3000;
Wave_Timer = 0;
Phase = 1;
Wave = false;
someplayer = 0;
goConsole = 0;
add = NULL;
}
2009-10-17 15:51:44 -07:00
2010-04-19 09:26:37 +02:00
void EnterCombat(Unit * /*who*/) {}
2009-10-17 15:51:44 -07:00
/*void SpellHit(Unit *caster, const SpellEntry *spell)
{
2009-08-15 00:32:04 +02:00
//we have no way of telling the Creature was hit by spell -> got aura applied after 10-12 seconds
//then no way for the mobs to actually stop the shutdown as intended.
2009-08-14 00:02:13 +02:00
if (spell->Id == SPELL_INTERRUPT_1)
DoSay("Silence! I kill you!",LANG_UNIVERSAL, NULL);
}*/
2009-10-17 15:51:44 -07:00
2010-04-19 09:26:37 +02:00
void JustDied(Unit* /*killer*/)
{
2010-04-14 23:07:41 +02:00
DoScriptText(EMOTE_ABORT, me);
2009-10-17 15:51:44 -07:00
2009-08-14 00:02:13 +02:00
if (someplayer)
{
2010-04-14 23:07:41 +02:00
Unit* p = Unit::GetUnit((*me),someplayer);
2009-08-14 00:02:13 +02:00
if (p && p->GetTypeId() == TYPEID_PLAYER)
{
2010-04-14 23:07:41 +02:00
switch(me->GetEntry())
{
case ENTRY_BNAAR_C_CONSOLE:
2009-06-04 16:36:33 -05:00
CAST_PLR(p)->FailQuest(10299);
CAST_PLR(p)->FailQuest(10329);
break;
case ENTRY_CORUU_C_CONSOLE:
2009-06-04 16:36:33 -05:00
CAST_PLR(p)->FailQuest(10321);
CAST_PLR(p)->FailQuest(10330);
break;
case ENTRY_DURO_C_CONSOLE:
2009-06-04 16:36:33 -05:00
CAST_PLR(p)->FailQuest(10322);
CAST_PLR(p)->FailQuest(10338);
break;
case ENTRY_ARA_C_CONSOLE:
2009-06-04 16:36:33 -05:00
CAST_PLR(p)->FailQuest(10323);
CAST_PLR(p)->FailQuest(10365);
break;
}
}
}
2009-10-17 15:51:44 -07:00
2009-08-14 00:02:13 +02:00
if (goConsole)
{
2010-04-14 23:07:41 +02:00
if (GameObject* pGo = GameObject::GetGameObject((*me),goConsole))
2009-08-15 00:32:04 +02:00
pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE);
}
}
2009-10-17 15:51:44 -07:00
2009-08-15 00:32:04 +02:00
void DoWaveSpawnForCreature(Creature* pCreature)
{
2009-08-15 00:32:04 +02:00
switch(pCreature->GetEntry())
{
case ENTRY_BNAAR_C_CONSOLE:
2009-08-14 00:02:13 +02:00
if (rand()%2)
{
2010-04-14 23:07:41 +02:00
add = me->SummonCreature(ENTRY_SUNFURY_TECH,2933.68,4162.55,164.00,1.60,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
2009-08-14 00:02:13 +02:00
if (add) add->GetMotionMaster()->MovePoint(0,2927.36,4212.97,164.00);
}
else
{
2010-04-14 23:07:41 +02:00
add = me->SummonCreature(ENTRY_SUNFURY_TECH,2927.36,4212.97,164.00,4.94,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
2009-08-14 00:02:13 +02:00
if (add) add->GetMotionMaster()->MovePoint(0,2933.68,4162.55,164.00);
}
Wave_Timer = 30000;
break;
case ENTRY_CORUU_C_CONSOLE:
2010-04-14 23:07:41 +02:00
add = me->SummonCreature(ENTRY_SUNFURY_TECH,2445.21,2765.26,134.49,3.93,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
2009-08-14 00:02:13 +02:00
if (add) add->GetMotionMaster()->MovePoint(0,2424.21,2740.15,133.81);
2010-04-14 23:07:41 +02:00
add = me->SummonCreature(ENTRY_SUNFURY_TECH,2429.86,2731.85,134.53,1.31,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
2009-08-14 00:02:13 +02:00
if (add) add->GetMotionMaster()->MovePoint(0,2435.37,2766.04,133.81);
Wave_Timer = 20000;
break;
case ENTRY_DURO_C_CONSOLE:
2010-04-14 23:07:41 +02:00
add = me->SummonCreature(ENTRY_SUNFURY_TECH,2986.80,2205.36,165.37,3.74,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
2009-08-14 00:02:13 +02:00
if (add) add->GetMotionMaster()->MovePoint(0,2985.15,2197.32,164.79);
2010-04-14 23:07:41 +02:00
add = me->SummonCreature(ENTRY_SUNFURY_TECH,2952.91,2191.20,165.32,0.22,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
2009-08-14 00:02:13 +02:00
if (add) add->GetMotionMaster()->MovePoint(0,2060.01,2185.27,164.67);
Wave_Timer = 15000;
break;
case ENTRY_ARA_C_CONSOLE:
2009-08-14 00:02:13 +02:00
if (rand()%2)
{
2010-04-14 23:07:41 +02:00
add = me->SummonCreature(ENTRY_ARA_TECH,4035.11,4038.97,194.27,2.57,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
2009-08-14 00:02:13 +02:00
if (add) add->GetMotionMaster()->MovePoint(0,4003.42,4040.19,193.49);
2010-04-14 23:07:41 +02:00
add = me->SummonCreature(ENTRY_ARA_TECH,4033.66,4036.79,194.28,2.57,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
2009-08-14 00:02:13 +02:00
if (add) add->GetMotionMaster()->MovePoint(0,4003.42,4040.19,193.49);
2010-04-14 23:07:41 +02:00
add = me->SummonCreature(ENTRY_ARA_TECH,4037.13,4037.30,194.23,2.57,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
2009-08-14 00:02:13 +02:00
if (add) add->GetMotionMaster()->MovePoint(0,4003.42,4040.19,193.49);
}
else
{
2010-04-14 23:07:41 +02:00
add = me->SummonCreature(ENTRY_ARA_TECH,3099.59,4049.30,194.22,0.05,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
2009-08-14 00:02:13 +02:00
if (add) add->GetMotionMaster()->MovePoint(0,4028.01,4035.17,193.59);
2010-04-14 23:07:41 +02:00
add = me->SummonCreature(ENTRY_ARA_TECH,3999.72,4046.75,194.22,0.05,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
2009-08-14 00:02:13 +02:00
if (add) add->GetMotionMaster()->MovePoint(0,4028.01,4035.17,193.59);
2010-04-14 23:07:41 +02:00
add = me->SummonCreature(ENTRY_ARA_TECH,3996.81,4048.26,194.22,0.05,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
2009-08-14 00:02:13 +02:00
if (add) add->GetMotionMaster()->MovePoint(0,4028.01,4035.17,193.59);
}
Wave_Timer = 15000;
break;
}
}
2009-08-15 00:32:04 +02:00
void DoFinalSpawnForCreature(Creature* pCreature)
{
2009-08-15 00:32:04 +02:00
switch(pCreature->GetEntry())
{
case ENTRY_BNAAR_C_CONSOLE:
2010-04-14 23:07:41 +02:00
add = me->SummonCreature(ENTRY_SUNFURY_TECH,2946.52,4201.42,163.47,3.54,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
2009-08-14 00:02:13 +02:00
if (add) add->GetMotionMaster()->MovePoint(0,2927.49,4192.81,163.00);
break;
case ENTRY_CORUU_C_CONSOLE:
2010-04-14 23:07:41 +02:00
add = me->SummonCreature(ENTRY_SUNFURY_TECH,2453.88,2737.85,133.27,2.59,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
2009-08-14 00:02:13 +02:00
if (add) add->GetMotionMaster()->MovePoint(0,2433.96,2751.53,133.85);
2010-04-14 23:07:41 +02:00
add = me->SummonCreature(ENTRY_SUNFURY_TECH,2441.62,2735.32,134.49,1.97,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
2009-08-14 00:02:13 +02:00
if (add) add->GetMotionMaster()->MovePoint(0,2433.96,2751.53,133.85);
2010-04-14 23:07:41 +02:00
add = me->SummonCreature(ENTRY_SUNFURY_TECH,2450.73,2754.50,134.49,3.29,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
2009-08-14 00:02:13 +02:00
if (add) add->GetMotionMaster()->MovePoint(0,2433.96,2751.53,133.85);
break;
case ENTRY_DURO_C_CONSOLE:
2010-04-14 23:07:41 +02:00
add = me->SummonCreature(ENTRY_SUNFURY_TECH,2956.18,2202.85,165.32,5.45,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
2009-08-14 00:02:13 +02:00
if (add) add->GetMotionMaster()->MovePoint(0,2972.27,2193.22,164.48);
2010-04-14 23:07:41 +02:00
add = me->SummonCreature(ENTRY_SUNFURY_TECH,2975.30,2211.50,165.32,4.55,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
2009-08-14 00:02:13 +02:00
if (add) add->GetMotionMaster()->MovePoint(0,2972.27,2193.22,164.48);
2010-04-14 23:07:41 +02:00
add = me->SummonCreature(ENTRY_SUNFURY_PROT,2965.02,2217.45,164.16,4.96,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
2009-08-14 00:02:13 +02:00
if (add) add->GetMotionMaster()->MovePoint(0,2972.27,2193.22,164.48);
break;
case ENTRY_ARA_C_CONSOLE:
2010-04-14 23:07:41 +02:00
add = me->SummonCreature(ENTRY_ARA_ENGI,3994.51,4020.46,192.18,0.91,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
2009-08-14 00:02:13 +02:00
if (add) add->GetMotionMaster()->MovePoint(0,4008.35,4035.04,192.70);
2010-04-14 23:07:41 +02:00
add = me->SummonCreature(ENTRY_ARA_GORKLONN,4021.56,4059.35,193.59,4.44,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
2009-08-14 00:02:13 +02:00
if (add) add->GetMotionMaster()->MovePoint(0,4016.62,4039.89,193.46);
break;
}
}
2009-10-17 15:51:44 -07:00
void UpdateAI(const uint32 diff)
{
2009-10-27 21:28:20 -07:00
if (Event_Timer <= diff)
{
switch(Phase)
{
case 1:
2009-08-14 00:02:13 +02:00
if (someplayer)
{
2010-04-14 23:07:41 +02:00
Unit* u = Unit::GetUnit((*me), someplayer);
if (u && u->GetTypeId() == TYPEID_PLAYER) DoScriptText(EMOTE_START, me, u);
}
Event_Timer = 60000;
Wave = true;
++Phase;
break;
case 2:
2010-04-14 23:07:41 +02:00
DoScriptText(EMOTE_60, me);
Event_Timer = 30000;
++Phase;
break;
case 3:
2010-04-14 23:07:41 +02:00
DoScriptText(EMOTE_30, me);
Event_Timer = 20000;
2010-04-14 23:07:41 +02:00
DoFinalSpawnForCreature(me);
++Phase;
break;
case 4:
2010-04-14 23:07:41 +02:00
DoScriptText(EMOTE_10, me);
Event_Timer = 10000;
Wave = false;
++Phase;
break;
case 5:
2010-04-14 23:07:41 +02:00
DoScriptText(EMOTE_COMPLETE, me);
2009-08-14 00:02:13 +02:00
if (someplayer)
{
2010-04-14 23:07:41 +02:00
Unit* u = Unit::GetUnit((*me),someplayer);
2009-08-14 00:02:13 +02:00
if (u && u->GetTypeId() == TYPEID_PLAYER)
2010-04-14 23:07:41 +02:00
CAST_PLR(u)->KilledMonsterCredit(me->GetEntry(),me->GetGUID());
DoCast(me, SPELL_DISABLE_VISUAL);
}
2009-08-14 00:02:13 +02:00
if (goConsole)
{
2010-04-14 23:07:41 +02:00
if (GameObject* pGo = GameObject::GetGameObject((*me),goConsole))
2009-08-15 00:32:04 +02:00
pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE);
}
++Phase;
break;
}
} else Event_Timer -= diff;
2009-10-17 15:51:44 -07:00
2009-08-14 00:02:13 +02:00
if (Wave)
{
2009-10-27 21:28:20 -07:00
if (Wave_Timer <= diff)
{
2010-04-14 23:07:41 +02:00
DoWaveSpawnForCreature(me);
} else Wave_Timer -= diff;
}
}
};
2009-08-14 00:39:07 +02:00
CreatureAI* GetAI_npc_manaforge_control_console(Creature* pCreature)
{
2009-08-14 00:39:07 +02:00
return new npc_manaforge_control_consoleAI (pCreature);
}
2009-10-17 15:51:44 -07:00
/*######
## go_manaforge_control_console
######*/
2009-10-17 15:51:44 -07:00
//TODO: clean up this workaround when Trinity adds support to do it properly (with gossip selections instead of instant summon)
2009-08-15 00:32:04 +02:00
bool GOHello_go_manaforge_control_console(Player* pPlayer, GameObject* pGo)
{
2009-08-15 00:32:04 +02:00
if (pGo->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER)
{
2009-08-15 00:32:04 +02:00
pPlayer->PrepareQuestMenu(pGo->GetGUID());
pPlayer->SendPreparedQuest(pGo->GetGUID());
}
2009-10-17 15:51:44 -07:00
Creature* manaforge = NULL;
2009-10-17 15:51:44 -07:00
2009-08-15 00:32:04 +02:00
switch(pGo->GetAreaId())
{
case 3726: //b'naar
2009-08-14 00:02:13 +02:00
if ((pPlayer->GetQuestStatus(10299) == QUEST_STATUS_INCOMPLETE || pPlayer->GetQuestStatus(10329) == QUEST_STATUS_INCOMPLETE) &&
pPlayer->HasItemCount(29366,1))
manaforge = pPlayer->SummonCreature(ENTRY_BNAAR_C_CONSOLE,2918.95,4189.98,161.88,0.34,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,125000);
break;
case 3730: //coruu
2009-08-14 00:02:13 +02:00
if ((pPlayer->GetQuestStatus(10321) == QUEST_STATUS_INCOMPLETE || pPlayer->GetQuestStatus(10330) == QUEST_STATUS_INCOMPLETE) &&
pPlayer->HasItemCount(29396,1))
manaforge = pPlayer->SummonCreature(ENTRY_CORUU_C_CONSOLE,2426.77,2750.38,133.24,2.14,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,125000);
break;
case 3734: //duro
2009-08-14 00:02:13 +02:00
if ((pPlayer->GetQuestStatus(10322) == QUEST_STATUS_INCOMPLETE || pPlayer->GetQuestStatus(10338) == QUEST_STATUS_INCOMPLETE) &&
pPlayer->HasItemCount(29397,1))
manaforge = pPlayer->SummonCreature(ENTRY_DURO_C_CONSOLE,2976.48,2183.29,163.20,1.85,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,125000);
break;
case 3722: //ara
2009-08-14 00:02:13 +02:00
if ((pPlayer->GetQuestStatus(10323) == QUEST_STATUS_INCOMPLETE || pPlayer->GetQuestStatus(10365) == QUEST_STATUS_INCOMPLETE) &&
pPlayer->HasItemCount(29411,1))
manaforge = pPlayer->SummonCreature(ENTRY_ARA_C_CONSOLE,4013.71,4028.76,192.10,1.25,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,125000);
break;
}
2009-10-17 15:51:44 -07:00
2009-08-14 00:02:13 +02:00
if (manaforge)
{
2009-08-14 00:02:13 +02:00
CAST_AI(npc_manaforge_control_consoleAI, manaforge->AI())->someplayer = pPlayer->GetGUID();
2009-08-15 00:32:04 +02:00
CAST_AI(npc_manaforge_control_consoleAI, manaforge->AI())->goConsole = pGo->GetGUID();
pGo->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE);
}
return true;
}
2009-10-17 15:51:44 -07:00
2008-12-20 19:10:00 +01:00
/*######
## npc_commander_dawnforge
######*/
2009-10-17 15:51:44 -07:00
2008-12-20 19:10:00 +01:00
// The Speech of Dawnforge, Ardonis & Pathaleon
#define SAY_COMMANDER_DAWNFORGE_1 -1000128
#define SAY_ARCANIST_ARDONIS_1 -1000129
#define SAY_COMMANDER_DAWNFORGE_2 -1000130
#define SAY_PATHALEON_CULATOR_IMAGE_1 -1000131
#define SAY_COMMANDER_DAWNFORGE_3 -1000132
#define SAY_PATHALEON_CULATOR_IMAGE_2 -1000133
#define SAY_PATHALEON_CULATOR_IMAGE_2_1 -1000134
#define SAY_PATHALEON_CULATOR_IMAGE_2_2 -1000135
#define SAY_COMMANDER_DAWNFORGE_4 -1000136
#define SAY_ARCANIST_ARDONIS_2 -1000136
#define SAY_COMMANDER_DAWNFORGE_5 -1000137
2009-10-17 15:51:44 -07:00
2008-12-20 19:10:00 +01:00
#define QUEST_INFO_GATHERING 10198
#define SPELL_SUNFURY_DISGUISE 34603
2009-10-17 15:51:44 -07:00
2008-12-20 19:10:00 +01:00
// Entries of Arcanist Ardonis, Commander Dawnforge, Pathaleon the Curators Image
2009-05-27 21:30:03 +02:00
const uint32 CreatureEntry[3] =
2008-12-20 19:10:00 +01:00
{
2009-05-27 21:30:03 +02:00
19830, // Ardonis
19831, // Dawnforge
21504 // Pathaleon
2008-12-20 19:10:00 +01:00
};
2009-10-17 15:51:44 -07:00
2010-02-05 00:31:28 +01:00
struct npc_commander_dawnforgeAI : public ScriptedAI
2008-12-20 19:10:00 +01:00
{
2009-02-09 08:16:34 -05:00
npc_commander_dawnforgeAI(Creature *c) : ScriptedAI(c) { Reset (); }
2008-12-20 19:10:00 +01:00
2009-08-14 00:02:13 +02:00
uint64 PlayerGUID;
2009-02-09 08:16:34 -05:00
uint64 ardonisGUID;
uint64 pathaleonGUID;
2008-12-20 19:10:00 +01:00
2009-02-09 08:16:34 -05:00
uint32 Phase;
uint32 PhaseSubphase;
uint32 Phase_Timer;
bool isEvent;
2009-10-17 15:51:44 -07:00
2009-02-09 08:16:34 -05:00
float angle_dawnforge;
float angle_ardonis;
2009-10-17 15:51:44 -07:00
2009-02-09 08:16:34 -05:00
void Reset()
{
2009-08-14 00:02:13 +02:00
PlayerGUID = 0;
2009-02-09 08:16:34 -05:00
ardonisGUID = 0;
pathaleonGUID = 0;
2009-10-17 15:51:44 -07:00
2009-02-09 08:16:34 -05:00
Phase = 1;
PhaseSubphase = 0;
Phase_Timer = 4000;
isEvent = false;
}
2009-10-17 15:51:44 -07:00
2010-04-19 09:26:37 +02:00
void EnterCombat(Unit * /*who*/) { }
2009-10-17 15:51:44 -07:00
2009-02-09 08:16:34 -05:00
void JustSummoned(Creature *summoned)
{
pathaleonGUID = summoned->GetGUID();
}
2009-10-17 15:51:44 -07:00
2009-02-09 08:16:34 -05:00
// Emote Ardonis and Pathaleon
void Turn_to_Pathaleons_Image()
{
2010-04-14 23:07:41 +02:00
Creature *ardonis = Unit::GetCreature(*me,ardonisGUID);
Creature *pathaleon = Unit::GetCreature(*me,pathaleonGUID);
2010-07-30 15:51:07 +02:00
Player* pPlayer = Unit::GetPlayer(*me, PlayerGUID);
2009-10-17 15:51:44 -07:00
2009-08-14 00:02:13 +02:00
if (!ardonis || !pathaleon || !pPlayer)
2009-02-09 08:16:34 -05:00
return;
2009-10-17 15:51:44 -07:00
2009-02-09 08:16:34 -05:00
//Calculate the angle to Pathaleon
2010-04-14 23:07:41 +02:00
angle_dawnforge = me->GetAngle(pathaleon->GetPositionX(), pathaleon->GetPositionY());
2009-02-09 08:16:34 -05:00
angle_ardonis = ardonis->GetAngle(pathaleon->GetPositionX(), pathaleon->GetPositionY());
2009-10-17 15:51:44 -07:00
2009-02-09 08:16:34 -05:00
//Turn Dawnforge and update
2010-04-14 23:07:41 +02:00
me->SetOrientation(angle_dawnforge);
me->SendUpdateToPlayer(pPlayer);
2009-02-09 08:16:34 -05:00
//Turn Ardonis and update
ardonis->SetOrientation(angle_ardonis);
2009-08-14 00:02:13 +02:00
ardonis->SendUpdateToPlayer(pPlayer);
2009-10-17 15:51:44 -07:00
2009-02-09 08:16:34 -05:00
//Set them to kneel
2010-04-14 23:07:41 +02:00
me->SetStandState(UNIT_STAND_STATE_KNEEL);
ardonis->SetStandState(UNIT_STAND_STATE_KNEEL);
2009-02-09 08:16:34 -05:00
}
2009-10-17 15:51:44 -07:00
2009-02-09 08:16:34 -05:00
//Set them back to each other
void Turn_to_eachother()
{
2010-04-14 23:07:41 +02:00
if (Unit *ardonis = Unit::GetUnit(*me,ardonisGUID))
2009-02-09 08:16:34 -05:00
{
2010-07-30 15:51:07 +02:00
Player* pPlayer = Unit::GetPlayer(*me, PlayerGUID);
2009-10-17 15:51:44 -07:00
2009-08-14 00:02:13 +02:00
if (!pPlayer)
2009-02-09 08:16:34 -05:00
return;
2009-10-17 15:51:44 -07:00
2010-04-14 23:07:41 +02:00
angle_dawnforge = me->GetAngle(ardonis->GetPositionX(), ardonis->GetPositionY());
angle_ardonis = ardonis->GetAngle(me->GetPositionX(), me->GetPositionY());
2009-10-17 15:51:44 -07:00
2009-02-09 08:16:34 -05:00
//Turn Dawnforge and update
2010-04-14 23:07:41 +02:00
me->SetOrientation(angle_dawnforge);
me->SendUpdateToPlayer(pPlayer);
2009-02-09 08:16:34 -05:00
//Turn Ardonis and update
ardonis->SetOrientation(angle_ardonis);
2009-08-14 00:02:13 +02:00
ardonis->SendUpdateToPlayer(pPlayer);
2009-10-17 15:51:44 -07:00
2009-02-09 08:16:34 -05:00
//Set state
2010-04-14 23:07:41 +02:00
me->SetStandState(UNIT_STAND_STATE_STAND);
ardonis->SetStandState(UNIT_STAND_STATE_STAND);
2009-02-09 08:16:34 -05:00
}
}
2009-10-17 15:51:44 -07:00
2009-08-14 00:02:13 +02:00
bool CanStartEvent(Player* pPlayer)
2009-02-09 08:16:34 -05:00
{
if (!isEvent)
{
2009-06-29 06:31:05 +02:00
Creature* ardonis = me->FindNearestCreature(CreatureEntry[0], 10.0f);
2009-02-09 08:16:34 -05:00
if (!ardonis)
return false;
2009-10-17 15:51:44 -07:00
2009-02-09 08:16:34 -05:00
ardonisGUID = ardonis->GetGUID();
2009-08-14 00:02:13 +02:00
PlayerGUID = pPlayer->GetGUID();
2009-10-17 15:51:44 -07:00
2009-02-09 08:16:34 -05:00
isEvent = true;
2009-10-17 15:51:44 -07:00
2009-02-09 08:16:34 -05:00
Turn_to_eachother();
return true;
}
2009-10-17 15:51:44 -07:00
sLog.outDebug("TSCR: npc_commander_dawnforge event already in progress, need to wait.");
2009-02-09 08:16:34 -05:00
return false;
}
2009-10-17 15:51:44 -07:00
2009-02-09 08:16:34 -05:00
void UpdateAI(const uint32 diff)
{
//Is event even running?
if (!isEvent)
return;
2009-10-17 15:51:44 -07:00
2009-02-09 08:16:34 -05:00
//Phase timing
if (Phase_Timer >= diff)
{
Phase_Timer -= diff;
return;
}
2009-10-17 15:51:44 -07:00
2010-04-14 23:07:41 +02:00
Unit *ardonis = Unit::GetUnit(*me,ardonisGUID);
Unit *pathaleon = Unit::GetUnit(*me,pathaleonGUID);
2010-07-30 15:51:07 +02:00
Player* pPlayer = Unit::GetPlayer(*me, PlayerGUID);
2009-10-17 15:51:44 -07:00
2009-08-14 00:02:13 +02:00
if (!ardonis || !pPlayer)
2009-02-09 08:16:34 -05:00
{
Reset();
return;
}
2009-10-17 15:51:44 -07:00
2009-02-09 08:16:34 -05:00
if (Phase > 4 && !pathaleon)
{
Reset();
return;
}
2009-10-17 15:51:44 -07:00
2009-02-09 08:16:34 -05:00
//Phase 1 Dawnforge say
switch (Phase)
{
case 1:
2010-04-14 23:07:41 +02:00
DoScriptText(SAY_COMMANDER_DAWNFORGE_1, me);
2009-02-09 08:16:34 -05:00
++Phase;
Phase_Timer = 16000;
break;
//Phase 2 Ardonis say
case 2:
DoScriptText(SAY_ARCANIST_ARDONIS_1, ardonis);
++Phase;
Phase_Timer = 16000;
break;
//Phase 3 Dawnforge say
case 3:
2010-04-14 23:07:41 +02:00
DoScriptText(SAY_COMMANDER_DAWNFORGE_2, me);
2009-02-09 08:16:34 -05:00
++Phase;
Phase_Timer = 16000;
break;
//Phase 4 Pathaleon spawns up to phase 9
case 4:
//spawn pathaleon's image
2010-04-14 23:07:41 +02:00
me->SummonCreature(CreatureEntry[2], 2325.851563, 2799.534668, 133.084229, 6.038996, TEMPSUMMON_TIMED_DESPAWN, 90000);
2009-02-09 08:16:34 -05:00
++Phase;
Phase_Timer = 500;
break;
//Phase 5 Pathaleon say
case 5:
DoScriptText(SAY_PATHALEON_CULATOR_IMAGE_1, pathaleon);
++Phase;
Phase_Timer = 6000;
break;
//Phase 6
case 6:
switch(PhaseSubphase)
{
//Subphase 1: Turn Dawnforge and Ardonis
case 0:
Turn_to_Pathaleons_Image();
++PhaseSubphase;
Phase_Timer = 8000;
break;
//Subphase 2 Dawnforge say
case 1:
2010-04-14 23:07:41 +02:00
DoScriptText(SAY_COMMANDER_DAWNFORGE_3, me);
2009-02-09 08:16:34 -05:00
PhaseSubphase = 0;
++Phase;
Phase_Timer = 8000;
break;
}
break;
//Phase 7 Pathaleons say 3 Sentence, every sentence need a subphase
case 7:
switch(PhaseSubphase)
{
//Subphase 1
case 0:
DoScriptText(SAY_PATHALEON_CULATOR_IMAGE_2, pathaleon);
++PhaseSubphase;
Phase_Timer = 12000;
break;
//Subphase 2
case 1:
DoScriptText(SAY_PATHALEON_CULATOR_IMAGE_2_1, pathaleon);
++PhaseSubphase;
Phase_Timer = 16000;
break;
//Subphase 3
case 2:
DoScriptText(SAY_PATHALEON_CULATOR_IMAGE_2_2, pathaleon);
PhaseSubphase = 0;
++Phase;
Phase_Timer = 10000;
break;
}
break;
//Phase 8 Dawnforge & Ardonis say
case 8:
2010-04-14 23:07:41 +02:00
DoScriptText(SAY_COMMANDER_DAWNFORGE_4, me);
2009-02-09 08:16:34 -05:00
DoScriptText(SAY_ARCANIST_ARDONIS_2, ardonis);
++Phase;
Phase_Timer = 4000;
break;
//Phase 9 Pathaleons Despawn, Reset Dawnforge & Ardonis angle
case 9:
Turn_to_eachother();
//hide pathaleon, unit will despawn shortly
pathaleon->SetVisibility(VISIBILITY_OFF);
PhaseSubphase = 0;
++Phase;
Phase_Timer = 3000;
break;
//Phase 10 Dawnforge say
case 10:
2010-04-14 23:07:41 +02:00
DoScriptText(SAY_COMMANDER_DAWNFORGE_5, me);
2009-08-14 00:02:13 +02:00
pPlayer->AreaExploredOrEventHappens(QUEST_INFO_GATHERING);
2009-02-09 08:16:34 -05:00
Reset();
break;
}
}
2008-12-20 19:10:00 +01:00
};
2009-10-17 15:51:44 -07:00
2009-08-14 00:39:07 +02:00
CreatureAI* GetAI_npc_commander_dawnforge(Creature* pCreature)
2008-12-20 19:10:00 +01:00
{
2009-08-14 00:39:07 +02:00
return new npc_commander_dawnforgeAI(pCreature);
2008-12-20 19:10:00 +01:00
}
2009-10-17 15:51:44 -07:00
2010-04-19 09:26:37 +02:00
bool AreaTrigger_at_commander_dawnforge(Player* pPlayer, const AreaTriggerEntry * /*at*/)
2008-12-20 19:10:00 +01:00
{
2009-02-09 08:16:34 -05:00
//if player lost aura or not have at all, we should not try start event.
2009-08-14 00:02:13 +02:00
if (!pPlayer->HasAura(SPELL_SUNFURY_DISGUISE))
2009-02-09 08:16:34 -05:00
return false;
2009-10-17 15:51:44 -07:00
2009-08-14 00:02:13 +02:00
if (pPlayer->isAlive() && pPlayer->GetQuestStatus(QUEST_INFO_GATHERING) == QUEST_STATUS_INCOMPLETE)
2009-02-09 08:16:34 -05:00
{
2009-08-14 00:02:13 +02:00
Creature* Dawnforge = pPlayer->FindNearestCreature(CreatureEntry[1], 30.0f);
2009-10-17 15:51:44 -07:00
2009-02-09 08:16:34 -05:00
if (!Dawnforge)
return false;
2009-10-17 15:51:44 -07:00
2009-08-14 00:02:13 +02:00
if (CAST_AI(npc_commander_dawnforgeAI, Dawnforge->AI())->CanStartEvent(pPlayer))
2009-02-09 08:16:34 -05:00
return true;
}
return false;
2008-12-20 19:10:00 +01:00
}
2009-10-17 15:51:44 -07:00
2008-12-26 20:25:31 +01:00
/*######
## npc_professor_dabiri
######*/
2009-10-17 15:51:44 -07:00
2009-02-09 08:16:34 -05:00
#define SPELL_PHASE_DISTRUPTOR 35780
#define GOSSIP_ITEM "I need a new phase distruptor, Professor"
2009-01-23 16:38:09 +01:00
#define WHISPER_DABIRI -1000302
2009-10-17 15:51:44 -07:00
2009-02-09 08:16:34 -05:00
#define QUEST_DIMENSIUS 10439
2008-12-26 20:25:31 +01:00
#define QUEST_ON_NETHERY_WINGS 10438
2009-10-17 15:51:44 -07:00
2009-08-14 00:39:07 +02:00
bool GossipHello_npc_professor_dabiri(Player* pPlayer, Creature* pCreature)
2008-12-26 20:25:31 +01:00
{
2009-08-14 00:39:07 +02:00
if (pCreature->isQuestGiver())
pPlayer->PrepareQuestMenu(pCreature->GetGUID());
2009-10-17 15:51:44 -07:00
2009-08-14 00:02:13 +02:00
if (pPlayer->GetQuestStatus(QUEST_ON_NETHERY_WINGS) == QUEST_STATUS_INCOMPLETE && !pPlayer->HasItemCount(29778, 1))
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
2009-10-17 15:51:44 -07:00
pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
2009-10-17 15:51:44 -07:00
2009-02-09 08:16:34 -05:00
return true;
2008-12-26 20:25:31 +01:00
}
2009-10-17 15:51:44 -07:00
2010-04-19 09:26:37 +02:00
bool GossipSelect_npc_professor_dabiri(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
2008-12-26 20:25:31 +01:00
{
2009-08-15 00:32:04 +02:00
if (uiAction == GOSSIP_ACTION_INFO_DEF+1)
2009-02-09 08:16:34 -05:00
{
2009-08-14 00:39:07 +02:00
pCreature->CastSpell(pPlayer, SPELL_PHASE_DISTRUPTOR, false);
2009-08-14 00:02:13 +02:00
pPlayer->CLOSE_GOSSIP_MENU();
2009-02-09 08:16:34 -05:00
}
2009-10-17 15:51:44 -07:00
2009-02-09 08:16:34 -05:00
return true;
2008-12-26 20:25:31 +01:00
}
2009-10-17 15:51:44 -07:00
2009-08-15 00:32:04 +02:00
bool QuestAccept_npc_professor_dabiri(Player* pPlayer, Creature* pCreature, Quest const *quest)
2008-12-26 20:25:31 +01:00
{
2009-08-14 00:02:13 +02:00
if (quest->GetQuestId() == QUEST_DIMENSIUS)
2009-08-15 00:32:04 +02:00
DoScriptText(WHISPER_DABIRI, pCreature, pPlayer);
2009-10-17 15:51:44 -07:00
2009-02-09 08:16:34 -05:00
return true;
2008-12-26 20:25:31 +01:00
}
2009-10-17 15:51:44 -07:00
/*######
## mob_phase_hunter
######*/
2009-10-17 15:51:44 -07:00
#define QUEST_RECHARGING_THE_BATTERIES 10190
#define NPC_PHASE_HUNTER_ENTRY 18879
#define NPC_DRAINED_PHASE_HUNTER_ENTRY 19595
#define EMOTE_WEAK -1000303
2009-10-17 15:51:44 -07:00
// Spells
#define SPELL_RECHARGING_BATTERY 34219
#define SPELL_PHASE_SLIP 36574
#define SPELL_MANA_BURN 13321
#define SPELL_MATERIALIZE 34804
#define SPELL_DE_MATERIALIZE 34814
2009-10-17 15:51:44 -07:00
2010-02-05 00:31:28 +01:00
struct mob_phase_hunterAI : public ScriptedAI
{
mob_phase_hunterAI(Creature *c) : ScriptedAI(c) {}
2009-10-17 15:51:44 -07:00
bool Weak;
2009-01-19 10:50:31 -06:00
bool Materialize;
bool Drained;
uint8 WeakPercent;
float HpPercent;
Player *pPlayer;
uint64 PlayerGUID;
2009-10-17 15:51:44 -07:00
uint32 ManaBurnTimer;
2009-10-17 15:51:44 -07:00
void Reset()
{
Weak = false;
2009-01-19 10:50:31 -06:00
Materialize = false;
Drained = false;
WeakPercent = 25 + (rand() % 16); // 25-40
HpPercent = 0.0f;
2009-10-17 15:51:44 -07:00
PlayerGUID = 0;
ManaBurnTimer = 5000 + (rand() % 3 * 1000); // 5-8 sec cd
2010-04-14 23:07:41 +02:00
if (me->GetEntry() == NPC_DRAINED_PHASE_HUNTER_ENTRY)
me->UpdateEntry(NPC_PHASE_HUNTER_ENTRY);
}
2009-10-17 15:51:44 -07:00
2010-04-19 09:26:37 +02:00
void EnterCombat(Unit * who)
{
if (who->GetTypeId() == TYPEID_PLAYER)
PlayerGUID = who->GetGUID();
}
2009-10-17 15:51:44 -07:00
2010-04-19 09:26:37 +02:00
void SpellHit(Unit * /*caster*/, const SpellEntry * /*spell*/)
2009-01-19 10:50:31 -06:00
{
2010-04-14 23:07:41 +02:00
DoCast(me, SPELL_DE_MATERIALIZE);
2009-01-19 10:50:31 -06:00
}
2009-10-17 15:51:44 -07:00
void UpdateAI(const uint32 diff)
{
2009-08-14 00:02:13 +02:00
if (!Materialize)
2009-01-19 10:50:31 -06:00
{
2010-04-14 23:07:41 +02:00
DoCast(me, SPELL_MATERIALIZE);
2009-01-19 10:50:31 -06:00
Materialize = true;
}
2009-10-17 15:51:44 -07:00
2010-04-14 23:07:41 +02:00
if (me->HasAuraType(SPELL_AURA_MOD_DECREASE_SPEED) || me->hasUnitState(UNIT_STAT_ROOT)) // if the mob is rooted/slowed by spells eg.: Entangling Roots, Frost Nova, Hamstring, Crippling Poison, etc. => remove it
DoCast(me, SPELL_PHASE_SLIP);
2009-10-17 15:51:44 -07:00
2009-01-30 18:10:05 -06:00
if (!UpdateVictim())
return;
2009-10-17 15:51:44 -07:00
// some code to cast spell Mana Burn on random target which has mana
if (ManaBurnTimer <= diff)
2009-01-19 10:50:31 -06:00
{
2010-04-14 23:07:41 +02:00
std::list<HostileReference*> AggroList = me->getThreatManager().getThreatList();
std::list<Unit*> UnitsWithMana;
2010-04-07 19:12:44 +02:00
for (std::list<HostileReference*>::const_iterator itr = AggroList.begin(); itr != AggroList.end(); ++itr)
2009-01-19 10:50:31 -06:00
{
2010-04-14 23:07:41 +02:00
if (Unit *pUnit = Unit::GetUnit(*me, (*itr)->getUnitGuid()))
{
2010-04-07 19:14:10 +02:00
if (pUnit->GetCreateMana() > 0)
UnitsWithMana.push_back(pUnit);
}
2009-01-19 10:50:31 -06:00
}
2010-04-07 19:14:10 +02:00
if (!UnitsWithMana.empty())
{
std::list<Unit*>::const_iterator it = UnitsWithMana.begin();
std::advance(it, rand() % UnitsWithMana.size());
DoCast(*it, SPELL_MANA_BURN);
ManaBurnTimer = 8000 + (rand() % 10 * 1000); // 8-18 sec cd
}
else
ManaBurnTimer = 3500;
2009-10-27 21:28:20 -07:00
} else ManaBurnTimer -= diff;
2009-10-17 15:51:44 -07:00
2010-07-30 15:51:07 +02:00
if (Player *pPlayer = Unit::GetPlayer(*me, PlayerGUID)) // start: support for quest 10190
2009-01-19 10:50:31 -06:00
{
2010-04-14 23:07:41 +02:00
if (!Weak && me->GetHealth() < (me->GetMaxHealth() / 100 * WeakPercent)
&& pPlayer->GetQuestStatus(QUEST_RECHARGING_THE_BATTERIES) == QUEST_STATUS_INCOMPLETE)
{
2010-04-14 23:07:41 +02:00
DoScriptText(EMOTE_WEAK, me);
2009-01-14 19:33:55 +01:00
Weak = true;
}
2010-04-14 23:07:41 +02:00
if (Weak && !Drained && me->HasAura(SPELL_RECHARGING_BATTERY))
2009-01-14 19:33:55 +01:00
{
Drained = true;
2010-04-14 23:07:41 +02:00
HpPercent = float(me->GetHealth()) / float(me->GetMaxHealth());
2009-10-17 15:51:44 -07:00
2010-04-14 23:07:41 +02:00
me->UpdateEntry(NPC_DRAINED_PHASE_HUNTER_ENTRY);
2009-10-17 15:51:44 -07:00
2010-04-14 23:07:41 +02:00
me->SetHealth(me->GetMaxHealth() * HpPercent);
me->LowerPlayerDamageReq(me->GetMaxHealth() - me->GetHealth());
me->SetInCombatWith(pPlayer);
2009-01-19 10:50:31 -06:00
}
} // end: support for quest 10190
2009-10-17 15:51:44 -07:00
2009-01-19 10:50:31 -06:00
DoMeleeAttackIfReady();
}
};
2009-10-17 15:51:44 -07:00
2009-08-14 00:39:07 +02:00
CreatureAI* GetAI_mob_phase_hunter(Creature* pCreature)
{
2009-08-14 00:39:07 +02:00
return new mob_phase_hunterAI (pCreature);
}
2009-10-17 15:51:44 -07:00
2009-01-14 19:33:55 +01:00
/*######
## npc_bessy
######*/
2009-10-17 15:51:44 -07:00
2009-01-14 19:33:55 +01:00
#define Q_ALMABTRIEB 10337
2009-01-23 16:38:09 +01:00
#define N_THADELL 20464
2009-01-14 19:33:55 +01:00
#define SPAWN_FIRST 20512
2009-01-23 16:38:09 +01:00
#define SPAWN_SECOND 19881
#define SAY_THADELL_1 -1000304
#define SAY_THADELL_2 -1000305
2009-10-17 15:51:44 -07:00
2010-02-05 00:31:28 +01:00
struct npc_bessyAI : public npc_escortAI
2009-01-14 19:33:55 +01:00
{
2009-10-17 15:51:44 -07:00
npc_bessyAI(Creature *c) : npc_escortAI(c) {}
2009-10-17 15:51:44 -07:00
2010-04-19 09:26:37 +02:00
void JustDied(Unit* /*killer*/)
2009-01-14 19:33:55 +01:00
{
2009-08-17 00:29:53 +02:00
if (Player* pPlayer = GetPlayerForEscort())
pPlayer->FailQuest(Q_ALMABTRIEB);
2009-01-14 19:33:55 +01:00
}
2009-10-17 15:51:44 -07:00
2009-01-14 19:33:55 +01:00
void WaypointReached(uint32 i)
{
2009-08-17 00:29:53 +02:00
Player* pPlayer = GetPlayerForEscort();
2009-10-17 15:51:44 -07:00
2009-08-14 00:02:13 +02:00
if (!pPlayer)
2009-01-14 19:33:55 +01:00
return;
2009-10-17 15:51:44 -07:00
switch(i)
2009-02-09 08:16:34 -05:00
{
2009-01-14 19:33:55 +01:00
case 3: //first spawn
2010-04-14 23:07:41 +02:00
me->SummonCreature(SPAWN_FIRST, 2449.67, 2183.11, 96.85, 6.20, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
me->SummonCreature(SPAWN_FIRST, 2449.53, 2184.43, 96.36, 6.27, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
me->SummonCreature(SPAWN_FIRST, 2449.85, 2186.34, 97.57, 6.08, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
2009-02-09 08:16:34 -05:00
break;
2009-10-17 15:51:44 -07:00
2009-01-14 19:33:55 +01:00
case 7:
2010-04-14 23:07:41 +02:00
me->SummonCreature(SPAWN_SECOND, 2309.64, 2186.24, 92.25, 6.06, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
me->SummonCreature(SPAWN_SECOND, 2309.25, 2183.46, 91.75, 6.22, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
2009-01-14 19:33:55 +01:00
break;
2009-10-17 15:51:44 -07:00
2009-01-14 19:33:55 +01:00
case 12:
2009-08-14 00:02:13 +02:00
if (pPlayer)
2010-04-14 23:07:41 +02:00
pPlayer->GroupEventHappens(Q_ALMABTRIEB, me);
2009-08-17 00:29:53 +02:00
if (Unit* Thadell = me->FindNearestCreature(N_THADELL, 30))
2010-04-14 23:07:41 +02:00
DoScriptText(SAY_THADELL_1, me); break;
2009-02-09 08:16:34 -05:00
case 13:
2009-08-17 00:29:53 +02:00
if (Unit* Thadell = me->FindNearestCreature(N_THADELL, 30))
2010-04-14 23:07:41 +02:00
DoScriptText(SAY_THADELL_2, me, pPlayer); break;
2009-02-09 08:16:34 -05:00
}
2009-01-14 19:33:55 +01:00
}
2009-10-17 15:51:44 -07:00
2009-02-09 08:16:34 -05:00
void JustSummoned(Creature* summoned)
2009-01-14 19:33:55 +01:00
{
2010-04-14 23:07:41 +02:00
summoned->AI()->AttackStart(me);
2009-01-14 19:33:55 +01:00
}
2009-10-17 15:51:44 -07:00
2009-01-14 19:33:55 +01:00
void Reset()
{
2009-08-17 00:29:53 +02:00
me->RestoreFaction();
2009-01-14 19:33:55 +01:00
}
2009-10-17 15:51:44 -07:00
2009-01-14 20:21:38 +01:00
};
2009-10-17 15:51:44 -07:00
2009-08-15 00:32:04 +02:00
bool QuestAccept_npc_bessy(Player* pPlayer, Creature* pCreature, Quest const* quest)
2009-01-14 19:33:55 +01:00
{
if (quest->GetQuestId() == Q_ALMABTRIEB)
{
2009-08-15 00:32:04 +02:00
pCreature->setFaction(113);
pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
CAST_AI(npc_escortAI, (pCreature->AI()))->Start(true, false, pPlayer->GetGUID());
2009-01-14 19:33:55 +01:00
}
return true;
}
2009-10-17 15:51:44 -07:00
2009-08-14 00:39:07 +02:00
CreatureAI* GetAI_npc_bessy(Creature* pCreature)
2009-01-14 19:33:55 +01:00
{
2009-08-17 00:29:53 +02:00
return new npc_bessyAI(pCreature);
2009-01-14 19:33:55 +01:00
}
2009-10-17 15:51:44 -07:00
/*######
##
######*/
2009-10-17 15:51:44 -07:00
void AddSC_netherstorm()
{
Script *newscript;
2009-10-17 15:51:44 -07:00
newscript = new Script;
newscript->Name = "go_manaforge_control_console";
newscript->pGOHello = &GOHello_go_manaforge_control_console;
newscript->RegisterSelf();
2009-10-17 15:51:44 -07:00
newscript = new Script;
newscript->Name = "npc_manaforge_control_console";
newscript->GetAI = &GetAI_npc_manaforge_control_console;
newscript->RegisterSelf();
2009-10-17 15:51:44 -07:00
2009-02-09 08:16:34 -05:00
newscript = new Script;
newscript->Name = "npc_commander_dawnforge";
newscript->GetAI = &GetAI_npc_commander_dawnforge;
newscript->RegisterSelf();
2009-10-17 15:51:44 -07:00
2009-02-09 08:16:34 -05:00
newscript = new Script;
newscript->Name = "at_commander_dawnforge";
newscript->pAreaTrigger = &AreaTrigger_at_commander_dawnforge;
newscript->RegisterSelf();
2009-10-17 15:51:44 -07:00
2009-02-09 08:16:34 -05:00
newscript = new Script;
newscript->Name = "npc_professor_dabiri";
newscript->pGossipHello = &GossipHello_npc_professor_dabiri;
2008-12-26 20:25:31 +01:00
newscript->pGossipSelect = &GossipSelect_npc_professor_dabiri;
2009-02-09 08:16:34 -05:00
newscript->pQuestAccept = &QuestAccept_npc_professor_dabiri;
newscript->RegisterSelf();
2009-10-17 15:51:44 -07:00
newscript = new Script;
newscript->Name = "mob_phase_hunter";
newscript->GetAI = &GetAI_mob_phase_hunter;
2009-01-14 19:33:55 +01:00
newscript->RegisterSelf();
2009-10-17 15:51:44 -07:00
2009-02-09 08:16:34 -05:00
newscript = new Script;
2009-01-14 19:33:55 +01:00
newscript->Name = "npc_bessy";
newscript->GetAI = &GetAI_npc_bessy;
newscript->pQuestAccept = &QuestAccept_npc_bessy;
newscript->RegisterSelf();
}
2009-02-17 20:07:49 -06:00