TrinityCore
pet_priest.cpp
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18/*
19 * Ordered alphabetically using scriptname.
20 * Scriptnames of files in this file should be prefixed with "npc_pet_pri_".
21 */
22
23#include "ScriptMgr.h"
24#include "Creature.h"
25#include "PassiveAI.h"
26#include "PetAI.h"
27#include "TemporarySummon.h"
28
30{
36};
37
38// 198236 - Divine Image
40{
41 npc_pet_pri_divine_image(Creature* creature) : PassiveAI(creature) { }
42
43 void IsSummonedBy(WorldObject* summoner) override
44 {
46
47 if (me->ToTempSummon()->IsGuardian() && summoner->IsUnit())
48 static_cast<Guardian*>(me)->SetBonusDamage(summoner->ToUnit()->SpellBaseHealingBonusDone(SPELL_SCHOOL_MASK_HOLY));
49 }
50
51 void OnDespawn() override
52 {
53 if (Unit* owner = me->GetOwner())
55 }
56};
57
58// 189820 - Lightwell
60{
62 {
64 }
65
66 void EnterEvadeMode(EvadeReason /*why*/) override
67 {
68 if (!me->IsAlive())
69 return;
70
71 me->CombatStop(true);
74 }
75};
76
77// 19668 - Shadowfiend
78// 62982 - Mindbender
80{
82
83 void IsSummonedBy(WorldObject* summonerWO) override
84 {
85 Unit* summoner = summonerWO->ToUnit();
86 if (!summoner)
87 return;
88
89 if (summoner->HasAura(SPELL_PRIEST_ATONEMENT))
91 }
92};
93
95{
99}
#define RegisterCreatureAI(ai_name)
Definition: ScriptMgr.h:1380
@ SPELL_SCHOOL_MASK_HOLY
@ TRIGGERED_FULL_MASK
Used when doing CastSpell with triggered == true.
Definition: SpellDefines.h:266
EvadeReason
Definition: UnitAICommon.h:30
Creature *const me
Definition: CreatureAI.h:61
void EngagementOver()
Definition: CreatureAI.cpp:287
void ResetPlayerDamageReq()
Definition: Creature.h:400
static Unit * ToUnit(Object *o)
Definition: Object.h:225
bool IsUnit() const
Definition: Object.h:224
Definition: PetAI.h:30
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.h:159
SpellCastResult DoCast(uint32 spellId)
Definition: UnitAI.cpp:89
Definition: Unit.h:627
void CombatStop(bool includingCast=false, bool mutualPvP=true, bool(*unitFilter)(Unit const *otherUnit)=nullptr)
Definition: Unit.cpp:5827
bool IsAlive() const
Definition: Unit.h:1164
TempSummon * ToTempSummon()
Definition: Unit.h:1756
bool IsGuardian() const
Definition: Unit.h:739
int32 SpellBaseHealingBonusDone(SpellSchoolMask schoolMask) const
Definition: Unit.cpp:7338
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition: Unit.cpp:4664
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition: Object.cpp:2896
Unit * GetOwner() const
Definition: Object.cpp:2229
PriestSpells
Definition: pet_priest.cpp:30
@ SPELL_PRIEST_ATONEMENT_PASSIVE
Definition: pet_priest.cpp:32
@ SPELL_PRIEST_DIVINE_IMAGE_SPELL_CHECK
Definition: pet_priest.cpp:33
@ SPELL_PRIEST_LIGHTWELL_CHARGES
Definition: pet_priest.cpp:35
@ SPELL_PRIEST_ATONEMENT
Definition: pet_priest.cpp:31
@ SPELL_PRIEST_INVOKE_THE_NAARU
Definition: pet_priest.cpp:34
void AddSC_priest_pet_scripts()
Definition: pet_priest.cpp:94
npc_pet_pri_divine_image(Creature *creature)
Definition: pet_priest.cpp:41
void IsSummonedBy(WorldObject *summoner) override
Definition: pet_priest.cpp:43
void OnDespawn() override
Definition: pet_priest.cpp:51
void EnterEvadeMode(EvadeReason) override
Definition: pet_priest.cpp:66
npc_pet_pri_lightwell(Creature *creature)
Definition: pet_priest.cpp:61
void IsSummonedBy(WorldObject *summonerWO) override
Definition: pet_priest.cpp:83
npc_pet_pri_shadowfiend_mindbender(Creature *creature)
Definition: pet_priest.cpp:81