TrinityCore
Loading...
Searching...
No Matches
ulduar.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#include "ScriptMgr.h"
19#include "ScriptedCreature.h"
20#include "Spell.h"
21#include "SpellAuraEffects.h"
22#include "SpellScript.h"
23
24// 61906 - Random Aggro Periodic (5 sec)
26{
27 void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
28 {
29 Unit* target = GetTarget();
31 if (!target->IsAIEnabled())
32 return;
33
34 if (Unit* victim = target->GetAI()->SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true, false))
35 {
36 target->GetThreatManager().AddThreat(victim, 3000000.0f, nullptr, true, true);
37 target->GetAI()->AttackStart(victim);
38 }
39 }
40
45};
46
47// 64014 - Expedition Base Camp Teleport
48// 64025 - Halls of Invention Teleport
49// 64028 - Colossal Forge Teleport
50// 64029 - Shattered Walkway Teleport
51// 64030 - Antechamber Teleport
52// 64032 - Formation Grounds Teleport
53// 65042 - Prison of Yogg-Saron Teleport
55{
57 {
58 if (GetExplTargetUnit()->GetTypeId() != TYPEID_PLAYER)
60
61 if (GetExplTargetUnit()->IsInCombat())
62 {
65 }
66
67 return SPELL_CAST_OK;
68 }
69
74};
75
@ TYPEID_PLAYER
Definition ObjectGuid.h:44
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1383
@ EFFECT_0
SpellCastResult
@ SPELL_FAILED_AFFECTING_COMBAT
@ SPELL_FAILED_DONT_REPORT
@ SPELL_CAST_OK
@ SPELL_AURA_PERIODIC_DUMMY
#define SpellCheckCastFn(F)
#define AuraEffectPeriodicFn(F, I, N)
HookList< EffectPeriodicHandler > OnEffectPeriodic
Unit * GetTarget() const
HookList< CheckCastHandler > OnCheckCast
Spell * GetSpell() const
Unit * GetExplTargetUnit() const
SpellInfo const * GetSpellInfo() const
static void SendCastResult(Player *caster, SpellInfo const *spellInfo, SpellCastVisual spellVisual, ObjectGuid cast_count, SpellCastResult result, SpellCustomErrors customError=SPELL_CUSTOM_ERROR_NONE, int32 *param1=nullptr, int32 *param2=nullptr)
Definition Spell.cpp:4699
void AddThreat(Unit *target, float amount, SpellInfo const *spell=nullptr, bool ignoreModifiers=false, bool ignoreRedirects=false)
== AFFECT MY THREAT LIST ==
virtual void AttackStart(Unit *victim)
Definition UnitAI.cpp:29
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition UnitAI.cpp:79
Definition Unit.h:635
ThreatManager & GetThreatManager()
Definition Unit.h:1078
UnitAI * GetAI() const
Definition Unit.h:668
bool IsAIEnabled() const
Definition Unit.h:666
void HandleEffectPeriodic(AuraEffect const *)
Definition ulduar.cpp:27
void Register() override
Definition ulduar.cpp:70
SpellCastResult CheckRequirement()
Definition ulduar.cpp:56
void AddSC_ulduar()
Definition ulduar.cpp:76