Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_hoptallus.cpp
Go to the documentation of this file.
1/*
2* This file is part of Project SkyFire https://www.projectskyfire.org.
3* See LICENSE.md file for Copyright information
4*/
5
6#include "ScriptMgr.h"
7#include "ScriptedCreature.h"
9#include "Player.h"
10#include "SpellScript.h"
11
18static const uint32 hoppers[2] = { 56718, 59426 };
19static const Position hopperSpawnPos[] =
20{
21 { -726.7f, 1257.9f, 166.8f, 0.24f },
22 { -720.86f, 1253.44f, 166.8f, 0.24f },
23 { -726.86f, 1247.41f, 166.8f, 0.25f },
24 { -719.38f, 1255.37f, 166.8f, 0.25f}
25};
26
27static const uint32 hoplings[5] = { 59461, 56631, 59459, 59458, 59460 };
28static const Position hoplingSpawnPos[] =
29{
30 { -719.31f, 1248.27f, 166.8f, 0.24f },
31 { -719.95f, 1250.89f, 166.8f, 0.24f },
32 { -720.66f, 1253.79f, 166.8f, 0.24f },
33 { -721.25f, 1256.18f, 166.8f, 0.24f },
34 { -721.94f, 1259.02f, 166.8f, 0.24f }
35};
36
38{
45public:
46 boss_hoptallus() : CreatureScript("boss_hoptallus") { }
47
48 struct boss_hoptallusAI : public BossAI
49 {
50 boss_hoptallusAI(Creature* creature) : BossAI(creature, DATA_HOPTALLUS) { }
51
52 void EnterCombat(Unit* /*who*/) OVERRIDE
53 {
55
56 //Talk(SAY_AGGRO);
57
58 events.ScheduleEvent(EVENT_SCREECH, 30000);
59 events.ScheduleEvent(EVENT_FURLWIND, DUNGEON_MODE(16000, 10000));
60 events.ScheduleEvent(EVENT_CARROT_BREATH, DUNGEON_MODE(30000, 15000));
61 }
62
63 void JustDied(Unit* /*killer*/) OVERRIDE
64 {
65 _JustDied();
66
67 //Talk(SAY_DEATH);
68 }
69
71 {
72 if (me->HasAura(SPELL_FURLWIND) || me->HasAura(SPELL_CARROT_BREATH) || me->HasUnitState(UNIT_STATE_CASTING))
73 return;
74
75 events.Update(diff);
76
77 while (uint32 eventId = events.ExecuteEvent())
78 {
79 switch (eventId)
80 {
81 case EVENT_FURLWIND:
82 {
84 events.ScheduleEvent(EVENT_FURLWIND, DUNGEON_MODE(50000, 40000));
85 break;
86 }
88 {
89 // Carrot Breath crashing server after 1st tick knockback
90 // DoCastVictim(SPELL_CARROT_BREATH);
91 events.ScheduleEvent(EVENT_CARROT_BREATH, DUNGEON_MODE(27000, 25000));
92 break;
93 }
94 case EVENT_SCREECH:
95 {
96 for (uint8 i = 0; i < 5; i++)
97 {
98 if (Creature* creature = me->SummonCreature(hoplings[i], hoplingSpawnPos[i], TempSummonType::TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000))
99 {
100 creature->setFaction(14);
101 creature->AddAura(114284, creature);
102
103 Position pos;
104 me->GetRandomNearPosition(pos, 10.f);
105 creature->GetMotionMaster()->MoveJump(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), 15.f, 15.f, EVENT_JUMP);
106 }
107 }
108
109 for (uint8 j = 0; j < 4; j++)
110 {
111 if (Creature* creature = me->SummonCreature(hoppers[j], hopperSpawnPos[j], TempSummonType::TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000))
112 {
113 creature->setFaction(14);
114 Position pos;
115 me->GetRandomNearPosition(pos, 10.f);
116 creature->GetMotionMaster()->MoveJump(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), 15.f, 15.f, EVENT_JUMP);
117 }
118 }
119
121 events.ScheduleEvent(EVENT_SCREECH, 30000);
122 break;
123 }
124 default:
125 break;
126 }
127 }
129 }
130 };
131
133 {
135 }
136};
137
139{
140 new boss_hoptallus();
141}
std::uint8_t uint8
Definition Define.h:79
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ TEMPSUMMON_CORPSE_TIMED_DESPAWN
Definition Object.h:73
@ EVENT_JUMP
@ UNIT_STATE_CASTING
Definition Unit.h:527
static const uint32 hoppers[2]
static const Position hopperSpawnPos[]
static const Position hoplingSpawnPos[]
@ SPELL_FURLWIND
@ SPELL_CARROT_BREATH
@ SPELL_HOPTALLUS_SCREECH
static const uint32 hoplings[5]
void AddSC_boss_hoptallus()
EventMap events
BossAI(Creature *creature, uint32 bossId)
void _EnterCombat()
CreatureScript(const char *name)
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:28
void DoCast(uint32 spellId)
Definition UnitAI.cpp:110
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:168
Definition Unit.h:1367
CreatureAI * GetAI(Creature *creature) const OVERRIDE
AI * GetStormstoutBreweryAI(Creature *creature)
@ DATA_HOPTALLUS
float GetPositionZ() const
Definition Object.h:330
float GetPositionX() const
Definition Object.h:328
float GetPositionY() const
Definition Object.h:329
Creature * me
const T & DUNGEON_MODE(const T &normal5, const T &heroic5) const
void EnterCombat(Unit *) OVERRIDE
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================