Files
TCPlayerbotCore/src/server/scripts/EasternKingdoms/undercity.cpp
T

255 lines
7.6 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: Undercity
SD%Complete: 95
2009-01-15 20:42:41 +01:00
SDComment: Quest support: 6628, 9180(post-event).
SDCategory: Undercity
EndScriptData */
2009-10-17 15:51:44 -07:00
/* ContentData
npc_lady_sylvanas_windrunner
npc_highborne_lamenter
npc_parqual_fintallas
EndContentData */
2009-10-17 15:51:44 -07:00
#include "ScriptPCH.h"
2009-10-17 15:51:44 -07:00
/*######
## npc_lady_sylvanas_windrunner
######*/
2009-10-17 15:51:44 -07:00
#define SAY_LAMENT_END -1000196
#define EMOTE_LAMENT_END -1000197
2009-10-17 15:51:44 -07:00
#define SOUND_CREDIT 10896
#define ENTRY_HIGHBORNE_LAMENTER 21628
#define ENTRY_HIGHBORNE_BUNNY 21641
2009-10-17 15:51:44 -07:00
#define SPELL_HIGHBORNE_AURA 37090
#define SPELL_SYLVANAS_CAST 36568
#define SPELL_RIBBON_OF_SOULS 34432 //the real one to use might be 37099
2009-10-17 15:51:44 -07:00
float HighborneLoc[4][3]=
{
{1285.41, 312.47, 0.51},
{1286.96, 310.40, 1.00},
{1289.66, 309.66, 1.52},
{1292.51, 310.50, 1.99},
};
2009-10-17 15:51:44 -07:00
#define HIGHBORNE_LOC_Y -61.00
#define HIGHBORNE_LOC_Y_NEW -55.50
2009-10-17 15:51:44 -07:00
2010-02-05 00:31:28 +01:00
struct npc_lady_sylvanas_windrunnerAI : public ScriptedAI
{
npc_lady_sylvanas_windrunnerAI(Creature *c) : ScriptedAI(c) {}
2009-10-17 15:51:44 -07:00
uint32 LamentEvent_Timer;
bool LamentEvent;
uint64 targetGUID;
2009-10-17 15:51:44 -07:00
void Reset()
{
LamentEvent_Timer = 5000;
LamentEvent = false;
targetGUID = 0;
}
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 JustSummoned(Creature *summoned)
{
2009-08-14 00:02:13 +02:00
if (summoned->GetEntry() == ENTRY_HIGHBORNE_BUNNY)
{
2009-10-27 21:28:20 -07:00
if (Unit *pTarget = Unit::GetUnit(*summoned,targetGUID))
{
2009-10-27 21:28:20 -07:00
pTarget->SendMonsterMove(pTarget->GetPositionX(), pTarget->GetPositionY(), me->GetPositionZ()+15.0,0);
2010-04-14 23:07:41 +02:00
pTarget->GetMap()->CreatureRelocation(me, pTarget->GetPositionX(), pTarget->GetPositionY(), me->GetPositionZ()+15.0, 0.0f);
2009-10-27 21:28:20 -07:00
summoned->CastSpell(pTarget, SPELL_RIBBON_OF_SOULS, false);
}
2009-10-17 15:51:44 -07:00
2009-04-22 17:50:26 -05:00
summoned->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
targetGUID = summoned->GetGUID();
}
}
2009-10-17 15:51:44 -07:00
void UpdateAI(const uint32 diff)
{
2009-08-14 00:02:13 +02:00
if (LamentEvent)
{
2009-10-27 21:28:20 -07:00
if (LamentEvent_Timer <= diff)
{
2009-08-29 23:20:16 -05:00
DoSummon(ENTRY_HIGHBORNE_BUNNY, me, 10.0f, 3000, TEMPSUMMON_TIMED_DESPAWN);
2009-10-17 15:51:44 -07:00
LamentEvent_Timer = 2000;
2010-04-14 23:07:41 +02:00
if (!me->HasAura(SPELL_SYLVANAS_CAST))
{
2010-04-14 23:07:41 +02:00
DoScriptText(SAY_LAMENT_END, me);
DoScriptText(EMOTE_LAMENT_END, me);
LamentEvent = false;
}
2009-10-27 21:28:20 -07:00
} else LamentEvent_Timer -= diff;
}
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
DoMeleeAttackIfReady();
}
};
2009-08-14 00:39:07 +02:00
CreatureAI* GetAI_npc_lady_sylvanas_windrunner(Creature* pCreature)
{
2009-08-14 00:39:07 +02:00
return new npc_lady_sylvanas_windrunnerAI (pCreature);
}
2009-10-17 15:51:44 -07:00
2010-04-19 09:26:37 +02:00
bool ChooseReward_npc_lady_sylvanas_windrunner(Player* /*pPlayer*/, Creature* pCreature, const Quest *_Quest, uint32 /*slot*/)
{
2009-08-14 00:02:13 +02:00
if (_Quest->GetQuestId() == 9180)
{
2009-08-14 00:39:07 +02:00
CAST_AI(npc_lady_sylvanas_windrunnerAI, pCreature->AI())->LamentEvent = true;
CAST_AI(npc_lady_sylvanas_windrunnerAI, pCreature->AI())->DoPlaySoundToSet(pCreature,SOUND_CREDIT);
pCreature->CastSpell(pCreature,SPELL_SYLVANAS_CAST,false);
2009-10-17 15:51:44 -07:00
2009-10-17 16:20:24 -07:00
for (uint8 i = 0; i < 4; ++i)
2009-08-14 00:39:07 +02:00
pCreature->SummonCreature(ENTRY_HIGHBORNE_LAMENTER, HighborneLoc[i][0], HighborneLoc[i][1], HIGHBORNE_LOC_Y, HighborneLoc[i][2], TEMPSUMMON_TIMED_DESPAWN, 160000);
}
2009-10-17 15:51:44 -07:00
return true;
}
2009-10-17 15:51:44 -07:00
/*######
## npc_highborne_lamenter
######*/
2009-10-17 15:51:44 -07:00
2010-02-05 00:31:28 +01:00
struct npc_highborne_lamenterAI : public ScriptedAI
{
npc_highborne_lamenterAI(Creature *c) : ScriptedAI(c) {}
2009-10-17 15:51:44 -07:00
uint32 EventMove_Timer;
uint32 EventCast_Timer;
bool EventMove;
bool EventCast;
2009-10-17 15:51:44 -07:00
void Reset()
{
EventMove_Timer = 10000;
EventCast_Timer = 17500;
EventMove = true;
EventCast = true;
}
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 UpdateAI(const uint32 diff)
{
2009-08-14 00:02:13 +02:00
if (EventMove)
{
2009-10-27 21:28:20 -07:00
if (EventMove_Timer <= diff)
{
2010-04-14 23:07:41 +02:00
me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
me->SendMonsterMoveWithSpeed(me->GetPositionX(),me->GetPositionY(),HIGHBORNE_LOC_Y_NEW,5000);
me->GetMap()->CreatureRelocation(me,me->GetPositionX(),me->GetPositionY(),HIGHBORNE_LOC_Y_NEW,me->GetOrientation());
EventMove = false;
2009-10-27 21:28:20 -07:00
} else EventMove_Timer -= diff;
}
2009-08-14 00:02:13 +02:00
if (EventCast)
{
2009-10-27 21:28:20 -07:00
if (EventCast_Timer <= diff)
{
2010-04-14 23:07:41 +02:00
DoCast(me, SPELL_HIGHBORNE_AURA);
EventCast = false;
2009-10-27 21:28:20 -07:00
} else EventCast_Timer -= diff;
}
}
};
2009-08-14 00:39:07 +02:00
CreatureAI* GetAI_npc_highborne_lamenter(Creature* pCreature)
{
2009-08-14 00:39:07 +02:00
return new npc_highborne_lamenterAI (pCreature);
}
2009-10-17 15:51:44 -07:00
/*######
## npc_parqual_fintallas
######*/
2009-10-17 15:51:44 -07:00
#define SPELL_MARK_OF_SHAME 6767
2009-10-17 15:51:44 -07:00
#define GOSSIP_HPF1 "Gul'dan"
#define GOSSIP_HPF2 "Kel'Thuzad"
#define GOSSIP_HPF3 "Ner'zhul"
2009-10-17 15:51:44 -07:00
2009-08-14 00:39:07 +02:00
bool GossipHello_npc_parqual_fintallas(Player* pPlayer, Creature* pCreature)
{
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(6628) == QUEST_STATUS_INCOMPLETE && !pPlayer->HasAura(SPELL_MARK_OF_SHAME))
{
2009-08-14 00:02:13 +02:00
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HPF1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HPF2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HPF3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
2009-08-14 00:39:07 +02:00
pPlayer->SEND_GOSSIP_MENU(5822, pCreature->GetGUID());
}
else
2009-08-14 00:39:07 +02:00
pPlayer->SEND_GOSSIP_MENU(5821, pCreature->GetGUID());
2009-10-17 15:51:44 -07:00
return true;
}
2009-10-17 15:51:44 -07:00
2010-04-19 09:26:37 +02:00
bool GossipSelect_npc_parqual_fintallas(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
{
2009-08-15 00:32:04 +02:00
if (uiAction == GOSSIP_ACTION_INFO_DEF+1)
{
2009-08-14 00:02:13 +02:00
pPlayer->CLOSE_GOSSIP_MENU();
2009-08-14 00:39:07 +02:00
pCreature->CastSpell(pPlayer,SPELL_MARK_OF_SHAME,false);
}
2009-08-15 00:32:04 +02:00
if (uiAction == GOSSIP_ACTION_INFO_DEF+2)
{
2009-08-14 00:02:13 +02:00
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->AreaExploredOrEventHappens(6628);
}
return true;
}
2009-10-17 15:51:44 -07:00
/*######
## AddSC
######*/
2009-10-17 15:51:44 -07:00
void AddSC_undercity()
{
Script *newscript;
2009-10-17 15:51:44 -07:00
newscript = new Script;
newscript->Name = "npc_lady_sylvanas_windrunner";
newscript->GetAI = &GetAI_npc_lady_sylvanas_windrunner;
newscript->pChooseReward = &ChooseReward_npc_lady_sylvanas_windrunner;
newscript->RegisterSelf();
2009-10-17 15:51:44 -07:00
newscript = new Script;
newscript->Name = "npc_highborne_lamenter";
newscript->GetAI = &GetAI_npc_highborne_lamenter;
newscript->RegisterSelf();
2009-10-17 15:51:44 -07:00
newscript = new Script;
newscript->Name = "npc_parqual_fintallas";
newscript->pGossipHello = &GossipHello_npc_parqual_fintallas;
newscript->pGossipSelect = &GossipSelect_npc_parqual_fintallas;
newscript->RegisterSelf();
}