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{
28
29 void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
30 {
31 Unit* target = GetTarget();
33 if (!target->IsAIEnabled())
34 return;
35
36 if (Unit* victim = target->GetAI()->SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true, false))
37 {
38 target->GetThreatManager().AddThreat(victim, 3000000.0f, nullptr, true, true);
39 target->GetAI()->AttackStart(victim);
40 }
41 }
42
47};
48
49// 64014 - Expedition Base Camp Teleport
50// 64025 - Halls of Invention Teleport
51// 64028 - Colossal Forge Teleport
52// 64029 - Shattered Walkway Teleport
53// 64030 - Antechamber Teleport
54// 64032 - Formation Grounds Teleport
55// 65042 - Prison of Yogg-Saron Teleport
79
@ TYPEID_PLAYER
Definition ObjectGuid.h:39
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1128
@ 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
Unit * GetExplTargetUnit() const
SpellInfo const * GetSpellInfo() const
static void SendCastResult(Player *caster, SpellInfo const *spellInfo, uint8 castCount, SpellCastResult result, SpellCustomErrors customError=SPELL_CUSTOM_ERROR_NONE, uint32 *param1=nullptr, uint32 *param2=nullptr)
Definition Spell.cpp:4177
void AddThreat(Unit *target, float amount, SpellInfo const *spell=nullptr, bool ignoreModifiers=false, bool ignoreRedirects=false)
== AFFECT MY THREAT LIST ==
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition UnitAI.cpp:96
virtual void AttackStart(Unit *)
Definition UnitAI.cpp:30
Definition Unit.h:769
ThreatManager & GetThreatManager()
Definition Unit.h:1155
UnitAI * GetAI() const
Definition Unit.h:800
bool IsAIEnabled() const
Definition Unit.h:798
void HandleEffectPeriodic(AuraEffect const *)
Definition ulduar.cpp:29
PrepareAuraScript(spell_ulduar_random_aggro_periodic)
PrepareSpellScript(spell_ulduar_teleporter)
void Register() override
Definition ulduar.cpp:74
SpellCastResult CheckRequirement()
Definition ulduar.cpp:60
void AddSC_ulduar()
Definition ulduar.cpp:80