Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
zone_isle_of_queldanas.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/* ScriptData
7SDName: Isle_of_Queldanas
8SD%Complete: 100
9SDComment: Quest support: 11524, 11525, 11532, 11533, 11542, 11543, 11541
10SDCategory: Isle Of Quel'Danas
11EndScriptData */
12
13/* ContentData
14npc_converted_sentry
15npc_greengill_slave
16EndContentData */
17
18#include "ScriptMgr.h"
19#include "ScriptedCreature.h"
20#include "Player.h"
21#include "Pet.h"
22#include "SpellInfo.h"
23
24/*######
25## npc_converted_sentry
26######*/
33
35{
36public:
37 npc_converted_sentry() : CreatureScript("npc_converted_sentry") { }
38
40 {
41 return new npc_converted_sentryAI(creature);
42 }
43
45 {
47 {
48 Credit = false;
49 Timer = 0;
50 }
51
53 {
54 Credit = false;
55 Timer = 2500;
56 }
57
58 void MoveInLineOfSight(Unit* /*who*/) OVERRIDE { }
59
60 void EnterCombat(Unit* /*who*/) OVERRIDE { }
61
63 {
64 if (!Credit)
65 {
66 if (Timer <= diff)
67 {
69
71 if (me->IsPet())
72 me->ToPet()->SetDuration(7500);
73 Credit = true;
74 } else Timer -= diff;
75 }
76 }
77
78 private:
79 bool Credit;
81 };
82};
83
84/*######
85## npc_greengill_slave
86######*/
87
88#define ENRAGE 45111
89#define ORB 45109
90#define QUESTG 11541
91#define DM 25060
92
94{
95public:
96 npc_greengill_slave() : CreatureScript("npc_greengill_slave") { }
97
99 {
100 return new npc_greengill_slaveAI(creature);
101 }
102
104 {
105 npc_greengill_slaveAI(Creature* creature) : ScriptedAI(creature) { }
106
107 void EnterCombat(Unit* /*who*/) OVERRIDE { }
108
109 void SpellHit(Unit* caster, SpellInfo const* spellInfo) OVERRIDE
110 {
111 Player* player = caster->ToPlayer();
112 if (!player)
113 return;
114
115 if (spellInfo->Id == ORB && !me->HasAura(ENRAGE))
116 {
118 DoCast(player, 45110, true);
119
120 DoCast(me, ENRAGE);
121
122 if (Creature* Myrmidon = me->FindNearestCreature(DM, 70))
123 {
124 me->AddThreat(Myrmidon, 100000.0f);
125 AttackStart(Myrmidon);
126 }
127 }
128 }
129
130 void UpdateAI(uint32 /*diff*/) OVERRIDE
131 {
133 }
134 };
135};
136
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ QUEST_STATUS_INCOMPLETE
Definition QuestDef.h:89
void Talk(uint8 id, WorldObject const *whisperTarget=NULL)
CreatureScript(const char *name)
Player * ToPlayer()
Definition Object.h:204
QuestStatus GetQuestStatus(uint32 quest_id) const
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:28
void DoCast(uint32 spellId)
Definition UnitAI.cpp:110
Definition Unit.h:1367
CreatureAI * GetAI(Creature *creature) const OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Creature * me
ScriptedAI(Creature *creature)
void AttackStart(Unit *) OVERRIDE
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void SpellHit(Unit *caster, SpellInfo const *spellInfo) OVERRIDE
void UpdateAI(uint32) OVERRIDE
== Triggered Actions Requested ==================
void AddSC_isle_of_queldanas()
#define ORB
#define ENRAGE
#define DM
#define QUESTG
@ SPELL_CONVERT_CREDIT