2013-08-09 19:22:16 +02:00
|
|
|
/*
|
2020-01-02 06:44:10 +01:00
|
|
|
* This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
|
2013-08-09 19:22:16 +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.
|
|
|
|
|
*
|
|
|
|
|
* 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/>.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Ordered alphabetically using scriptname.
|
|
|
|
|
* Scriptnames of files in this file should be prefixed with "npc_pet_pri_".
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "ScriptMgr.h"
|
2022-02-13 15:07:00 +01:00
|
|
|
#include "Creature.h"
|
2013-08-09 19:59:52 +02:00
|
|
|
#include "PassiveAI.h"
|
2013-08-09 19:22:16 +02:00
|
|
|
#include "PetAI.h"
|
|
|
|
|
|
|
|
|
|
enum PriestSpells
|
|
|
|
|
{
|
|
|
|
|
SPELL_PRIEST_GLYPH_OF_SHADOWFIEND = 58228,
|
2016-09-25 20:48:31 -03:00
|
|
|
SPELL_PRIEST_SHADOWFIEND_DEATH = 57989,
|
2013-08-09 19:22:16 +02:00
|
|
|
SPELL_PRIEST_LIGHTWELL_CHARGES = 59907
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class npc_pet_pri_lightwell : public CreatureScript
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
npc_pet_pri_lightwell() : CreatureScript("npc_pet_pri_lightwell") { }
|
|
|
|
|
|
|
|
|
|
struct npc_pet_pri_lightwellAI : public PassiveAI
|
|
|
|
|
{
|
|
|
|
|
npc_pet_pri_lightwellAI(Creature* creature) : PassiveAI(creature)
|
|
|
|
|
{
|
|
|
|
|
DoCast(me, SPELL_PRIEST_LIGHTWELL_CHARGES, false);
|
|
|
|
|
}
|
|
|
|
|
|
2016-01-13 15:33:17 +01:00
|
|
|
void EnterEvadeMode(EvadeReason /*why*/) override
|
2013-08-09 19:22:16 +02:00
|
|
|
{
|
|
|
|
|
if (!me->IsAlive())
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
me->CombatStop(true);
|
2019-07-21 01:49:58 +02:00
|
|
|
EngagementOver();
|
2013-08-09 19:22:16 +02:00
|
|
|
me->ResetPlayerDamageReq();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2014-04-29 16:35:11 +02:00
|
|
|
CreatureAI* GetAI(Creature* creature) const override
|
2013-08-09 19:22:16 +02:00
|
|
|
{
|
|
|
|
|
return new npc_pet_pri_lightwellAI(creature);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class npc_pet_pri_shadowfiend : public CreatureScript
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
npc_pet_pri_shadowfiend() : CreatureScript("npc_pet_pri_shadowfiend") { }
|
|
|
|
|
|
|
|
|
|
struct npc_pet_pri_shadowfiendAI : public PetAI
|
|
|
|
|
{
|
|
|
|
|
npc_pet_pri_shadowfiendAI(Creature* creature) : PetAI(creature) { }
|
|
|
|
|
|
2019-05-23 21:08:29 +02:00
|
|
|
void IsSummonedBy(WorldObject* summonerWO) override
|
2013-08-09 19:22:16 +02:00
|
|
|
{
|
2019-05-23 21:08:29 +02:00
|
|
|
Unit* summoner = summonerWO->ToUnit();
|
|
|
|
|
if (!summoner)
|
|
|
|
|
return;
|
|
|
|
|
|
2016-09-25 20:48:31 -03:00
|
|
|
if (summoner->HasAura(SPELL_PRIEST_GLYPH_OF_SHADOWFIEND))
|
|
|
|
|
DoCastAOE(SPELL_PRIEST_SHADOWFIEND_DEATH);
|
2013-08-09 19:22:16 +02:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2014-04-29 16:35:11 +02:00
|
|
|
CreatureAI* GetAI(Creature* creature) const override
|
2013-08-09 19:22:16 +02:00
|
|
|
{
|
|
|
|
|
return new npc_pet_pri_shadowfiendAI(creature);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
void AddSC_priest_pet_scripts()
|
|
|
|
|
{
|
|
|
|
|
new npc_pet_pri_lightwell();
|
|
|
|
|
new npc_pet_pri_shadowfiend();
|
|
|
|
|
}
|