TrinityCore
Loading...
Searching...
No Matches
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
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
#define RegisterCreatureAI(ai_name)
Definition ScriptMgr.h:1392
@ SPELL_SCHOOL_MASK_HOLY
@ TRIGGERED_FULL_MASK
Used when doing CastSpell with triggered == true.
EvadeReason
bool IsUnit() const
Definition BaseEntity.h:171
Creature *const me
Definition CreatureAI.h:63
void EngagementOver()
void ResetPlayerDamageReq()
Definition Creature.h:415
Unit * ToUnit()
Definition Object.h:116
Definition PetAI.h:30
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:160
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:89
Definition Unit.h:635
void CombatStop(bool includingCast=false, bool mutualPvP=true, bool(*unitFilter)(Unit const *otherUnit)=nullptr)
Definition Unit.cpp:6012
bool IsAlive() const
Definition Unit.h:1185
TempSummon * ToTempSummon()
Definition Unit.h:1828
bool IsGuardian() const
Definition Unit.h:750
int32 SpellBaseHealingBonusDone(SpellSchoolMask schoolMask) const
Definition Unit.cpp:7583
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition Unit.cpp:4804
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2217
Unit * GetOwner() const
Definition Object.cpp:1598
PriestSpells
@ SPELL_PRIEST_ATONEMENT_PASSIVE
@ SPELL_PRIEST_DIVINE_IMAGE_SPELL_CHECK
@ SPELL_PRIEST_LIGHTWELL_CHARGES
@ SPELL_PRIEST_ATONEMENT
@ SPELL_PRIEST_INVOKE_THE_NAARU
void AddSC_priest_pet_scripts()
npc_pet_pri_divine_image(Creature *creature)
void IsSummonedBy(WorldObject *summoner) override
void OnDespawn() override
void EnterEvadeMode(EvadeReason) override
npc_pet_pri_lightwell(Creature *creature)
void IsSummonedBy(WorldObject *summonerWO) override
npc_pet_pri_shadowfiend_mindbender(Creature *creature)