2010-07-06 03:27:41 +02:00
|
|
|
/*
|
|
|
|
|
* Copyright (C) 2008-2010 TrinityCore <http://www.trinitycore.org/>
|
|
|
|
|
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
|
2009-09-19 15:14:05 -07: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.
|
2009-09-19 15:14:05 -07: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/>.
|
2009-09-19 15:14:05 -07:00
|
|
|
*/
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2009-09-19 15:14:05 -07:00
|
|
|
/* ScriptData
|
|
|
|
|
SDName: Duskwood
|
|
|
|
|
SD%Complete: 100
|
|
|
|
|
SDComment: Quest Support:8735
|
|
|
|
|
SDCategory: Duskwood
|
|
|
|
|
EndScriptData */
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2010-06-08 23:44:55 +02:00
|
|
|
#include "ScriptPCH.h"
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2009-09-19 15:14:05 -07:00
|
|
|
/*######
|
|
|
|
|
# at_twilight_grove
|
|
|
|
|
######*/
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2010-04-19 09:26:37 +02:00
|
|
|
bool AreaTrigger_at_twilight_grove(Player* pPlayer, const AreaTriggerEntry * /*at*/)
|
2009-09-19 15:14:05 -07:00
|
|
|
{
|
|
|
|
|
if (pPlayer->HasQuestForItem(21149))
|
|
|
|
|
{
|
2010-04-07 19:14:10 +02:00
|
|
|
if (Unit* TCorrupter = pPlayer->SummonCreature(15625,-10328.16,-489.57,49.95,0,TEMPSUMMON_MANUAL_DESPAWN,60000))
|
2009-09-20 13:53:01 +02:00
|
|
|
{
|
|
|
|
|
TCorrupter->setFaction(14);
|
|
|
|
|
TCorrupter->SetMaxHealth(832750);
|
|
|
|
|
}
|
2010-04-07 19:14:10 +02:00
|
|
|
if (Unit* CorrupterSpeaker = pPlayer->SummonCreature(1,pPlayer->GetPositionX(),pPlayer->GetPositionY(),pPlayer->GetPositionZ()-1,0,TEMPSUMMON_TIMED_DESPAWN,15000))
|
2009-09-20 13:53:01 +02:00
|
|
|
{
|
|
|
|
|
CorrupterSpeaker->SetName("Twilight Corrupter");
|
|
|
|
|
CorrupterSpeaker->SetVisibility(VISIBILITY_ON);
|
|
|
|
|
CorrupterSpeaker->MonsterYell("Come, $N. See what the Nightmare brings...",0,pPlayer->GetGUID());
|
|
|
|
|
}
|
2009-09-19 15:14:05 -07:00
|
|
|
}
|
2009-09-20 13:53:01 +02:00
|
|
|
return false;
|
2009-09-19 15:14:05 -07:00
|
|
|
};
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2009-09-19 15:14:05 -07:00
|
|
|
/*######
|
|
|
|
|
# boss_twilight_corrupter
|
|
|
|
|
######*/
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2009-09-19 15:14:05 -07:00
|
|
|
#define SPELL_SOUL_CORRUPTION 25805
|
|
|
|
|
#define SPELL_CREATURE_OF_NIGHTMARE 25806
|
|
|
|
|
#define SPELL_LEVEL_UP 24312
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2010-02-05 00:31:28 +01:00
|
|
|
struct boss_twilight_corrupterAI : public ScriptedAI
|
2009-09-19 15:14:05 -07:00
|
|
|
{
|
|
|
|
|
boss_twilight_corrupterAI(Creature *c) : ScriptedAI(c) {}
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2009-09-19 15:14:05 -07:00
|
|
|
uint32 SoulCorruption_Timer;
|
|
|
|
|
uint32 CreatureOfNightmare_Timer;
|
|
|
|
|
uint8 KillCount;
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2009-09-19 15:14:05 -07:00
|
|
|
void Reset()
|
|
|
|
|
{
|
|
|
|
|
SoulCorruption_Timer = 15000;
|
|
|
|
|
CreatureOfNightmare_Timer = 30000;
|
|
|
|
|
KillCount = 0;
|
|
|
|
|
}
|
2010-04-19 09:26:37 +02:00
|
|
|
void EnterCombat(Unit* /*who*/)
|
2009-09-19 15:14:05 -07:00
|
|
|
{
|
2010-04-14 23:07:41 +02:00
|
|
|
me->MonsterYell("The Nightmare cannot be stopped!",0,me->GetGUID());
|
2009-09-19 15:14:05 -07:00
|
|
|
}
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2009-09-19 15:14:05 -07:00
|
|
|
void KilledUnit(Unit* victim)
|
|
|
|
|
{
|
|
|
|
|
if (victim->GetTypeId() == TYPEID_PLAYER)
|
|
|
|
|
{
|
|
|
|
|
++KillCount;
|
2010-04-14 23:07:41 +02:00
|
|
|
me->MonsterTextEmote("Twilight Corrupter squeezes the last bit of life out of $N and swallows their soul.", victim->GetGUID(),true);
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2009-09-19 15:14:05 -07:00
|
|
|
if (KillCount == 3)
|
|
|
|
|
{
|
2010-04-14 23:07:41 +02:00
|
|
|
DoCast(me, SPELL_LEVEL_UP, true);
|
2009-09-19 15:14:05 -07:00
|
|
|
KillCount = 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2009-09-19 15:14:05 -07:00
|
|
|
void UpdateAI(const uint32 diff)
|
|
|
|
|
{
|
2010-04-07 19:14:10 +02:00
|
|
|
if (!UpdateVictim())
|
2009-09-19 15:14:05 -07:00
|
|
|
return;
|
2009-10-27 21:28:20 -07:00
|
|
|
if (SoulCorruption_Timer <= diff)
|
2009-09-19 15:14:05 -07:00
|
|
|
{
|
2010-04-14 23:07:41 +02:00
|
|
|
DoCast(me->getVictim(), SPELL_SOUL_CORRUPTION);
|
2009-09-19 15:14:05 -07:00
|
|
|
SoulCorruption_Timer = rand()%4000+15000; //gotta confirm Timers
|
|
|
|
|
} else SoulCorruption_Timer-=diff;
|
2009-10-27 21:28:20 -07:00
|
|
|
if (CreatureOfNightmare_Timer <= diff)
|
2009-09-19 15:14:05 -07:00
|
|
|
{
|
2010-04-14 23:07:41 +02:00
|
|
|
DoCast(me->getVictim(), SPELL_CREATURE_OF_NIGHTMARE);
|
2009-09-19 15:14:05 -07:00
|
|
|
CreatureOfNightmare_Timer = 45000; //gotta confirm Timers
|
|
|
|
|
} else CreatureOfNightmare_Timer-=diff;
|
|
|
|
|
DoMeleeAttackIfReady();
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
CreatureAI* GetAI_boss_twilight_corrupter(Creature* pCreature)
|
|
|
|
|
{
|
|
|
|
|
return new boss_twilight_corrupterAI (pCreature);
|
|
|
|
|
}
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2009-09-19 15:14:05 -07:00
|
|
|
void AddSC_duskwood()
|
|
|
|
|
{
|
|
|
|
|
Script *newscript;
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2009-09-19 15:14:05 -07:00
|
|
|
newscript = new Script;
|
2009-10-17 04:23:24 -07:00
|
|
|
newscript->Name = "boss_twilight_corrupter";
|
2009-09-19 15:14:05 -07:00
|
|
|
newscript->GetAI = &GetAI_boss_twilight_corrupter;
|
|
|
|
|
newscript->RegisterSelf();
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2009-09-19 15:14:05 -07:00
|
|
|
newscript = new Script;
|
2009-10-17 04:23:24 -07:00
|
|
|
newscript->Name = "at_twilight_grove";
|
2009-09-19 15:14:05 -07:00
|
|
|
newscript->pAreaTrigger = &AreaTrigger_at_twilight_grove;
|
|
|
|
|
newscript->RegisterSelf();
|
|
|
|
|
}
|