Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
zone_crystalsong_forest.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
/* Script Data Start
7
SDName: CrystalSongForest
8
SDAuthor: Malcrom
9
SD%Complete: 99%
10
SDComment:
11
SDCategory: CrystalsongForest
12
Script Data End */
13
14
#include "
ScriptMgr.h
"
15
#include "
ScriptedCreature.h
"
16
#include "
Player.h
"
17
18
/*******************************************************
19
* npc_warmage_violetstand
20
*******************************************************/
21
22
enum
Spells
23
{
24
SPELL_TRANSITUS_SHIELD_BEAM
= 48310
25
};
26
27
enum
NPCs
28
{
29
NPC_TRANSITUS_SHIELD_DUMMY
= 27306,
30
NPC_WARMAGE_SARINA
= 32369,
31
NPC_WARMAGE_HALISTER
= 32371,
32
NPC_WARMAGE_ILSUDRIA
= 32372
33
};
34
35
class
npc_warmage_violetstand
:
public
CreatureScript
36
{
37
public
:
38
npc_warmage_violetstand
() :
CreatureScript
(
"npc_warmage_violetstand"
) { }
39
40
struct
npc_warmage_violetstandAI
:
public
ScriptedAI
41
{
42
npc_warmage_violetstandAI
(
Creature
* creature) :
ScriptedAI
(creature)
43
{
44
SetCombatMovement
(
false
);
45
}
46
47
uint64
uiTargetGUID
;
48
49
void
Reset
()
OVERRIDE
50
{
51
uiTargetGUID
= 0;
52
}
53
54
void
UpdateAI
(
uint32
/*uiDiff*/
)
OVERRIDE
55
{
56
if
(
me
->IsNonMeleeSpellCasted(
false
))
57
return
;
58
59
if
(
me
->GetEntry() ==
NPC_WARMAGE_SARINA
)
60
{
61
if
(!
uiTargetGUID
)
62
{
63
std::list<Creature*> orbList;
64
GetCreatureListWithEntryInGrid
(orbList,
me
,
NPC_TRANSITUS_SHIELD_DUMMY
, 32.0f);
65
if
(!orbList.empty())
66
{
67
for
(std::list<Creature*>::const_iterator itr = orbList.begin(); itr != orbList.end(); ++itr)
68
{
69
if
(
Creature
* pOrb = *itr)
70
{
71
if
(pOrb->GetPositionY() < 1000)
72
{
73
uiTargetGUID
= pOrb->GetGUID();
74
break
;
75
}
76
}
77
}
78
}
79
}
80
}
else
81
{
82
if
(!
uiTargetGUID
)
83
if
(
Creature
* pOrb =
GetClosestCreatureWithEntry
(
me
,
NPC_TRANSITUS_SHIELD_DUMMY
, 32.0f))
84
uiTargetGUID
= pOrb->GetGUID();
85
}
86
87
if
(
Creature
* pOrb =
me
->GetCreature(*
me
,
uiTargetGUID
))
88
DoCast
(pOrb,
SPELL_TRANSITUS_SHIELD_BEAM
);
89
}
90
};
91
92
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
93
{
94
return
new
npc_warmage_violetstandAI
(creature);
95
}
96
};
97
98
void
AddSC_crystalsong_forest
()
99
{
100
new
npc_warmage_violetstand
;
101
}
Spells
Spells
Definition
BattlegroundIC.h:645
uint32
std::uint32_t uint32
Definition
Define.h:77
OVERRIDE
#define OVERRIDE
Definition
Define.h:60
uint64
std::uint64_t uint64
Definition
Define.h:76
Player.h
ScriptMgr.h
GetClosestCreatureWithEntry
Creature * GetClosestCreatureWithEntry(WorldObject *source, uint32 entry, float maxSearchRange, bool alive)
Definition
ScriptedCreature.cpp:662
NPCs
NPCs
Definition
ScriptedCreature.cpp:400
GetCreatureListWithEntryInGrid
void GetCreatureListWithEntryInGrid(std::list< Creature * > &list, WorldObject *source, uint32 entry, float maxSearchRange)
Definition
ScriptedCreature.cpp:672
ScriptedCreature.h
CreatureAI
Definition
CreatureAI.h:54
Creature
Definition
Creature.h:427
CreatureScript::CreatureScript
CreatureScript(const char *name)
Definition
ScriptMgr.cpp:1436
UnitAI::DoCast
void DoCast(uint32 spellId)
Definition
UnitAI.cpp:110
npc_warmage_violetstand
Definition
zone_crystalsong_forest.cpp:36
npc_warmage_violetstand::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
zone_crystalsong_forest.cpp:92
npc_warmage_violetstand::npc_warmage_violetstand
npc_warmage_violetstand()
Definition
zone_crystalsong_forest.cpp:38
ScriptedAI::SetCombatMovement
void SetCombatMovement(bool allowMovement)
Definition
ScriptedCreature.cpp:394
ScriptedAI::me
Creature * me
Definition
ScriptedCreature.h:182
ScriptedAI::ScriptedAI
ScriptedAI(Creature *creature)
Definition
ScriptedCreature.cpp:85
npc_warmage_violetstand::npc_warmage_violetstandAI
Definition
zone_crystalsong_forest.cpp:41
npc_warmage_violetstand::npc_warmage_violetstandAI::Reset
void Reset() OVERRIDE
Definition
zone_crystalsong_forest.cpp:49
npc_warmage_violetstand::npc_warmage_violetstandAI::UpdateAI
void UpdateAI(uint32) OVERRIDE
== Triggered Actions Requested ==================
Definition
zone_crystalsong_forest.cpp:54
npc_warmage_violetstand::npc_warmage_violetstandAI::npc_warmage_violetstandAI
npc_warmage_violetstandAI(Creature *creature)
Definition
zone_crystalsong_forest.cpp:42
npc_warmage_violetstand::npc_warmage_violetstandAI::uiTargetGUID
uint64 uiTargetGUID
Definition
zone_crystalsong_forest.cpp:47
SPELL_TRANSITUS_SHIELD_BEAM
@ SPELL_TRANSITUS_SHIELD_BEAM
Definition
zone_borean_tundra.cpp:2201
NPC_TRANSITUS_SHIELD_DUMMY
@ NPC_TRANSITUS_SHIELD_DUMMY
Definition
zone_borean_tundra.cpp:2206
SPELL_TRANSITUS_SHIELD_BEAM
@ SPELL_TRANSITUS_SHIELD_BEAM
Definition
zone_crystalsong_forest.cpp:24
AddSC_crystalsong_forest
void AddSC_crystalsong_forest()
Definition
zone_crystalsong_forest.cpp:98
NPC_TRANSITUS_SHIELD_DUMMY
@ NPC_TRANSITUS_SHIELD_DUMMY
Definition
zone_crystalsong_forest.cpp:29
NPC_WARMAGE_HALISTER
@ NPC_WARMAGE_HALISTER
Definition
zone_crystalsong_forest.cpp:31
NPC_WARMAGE_ILSUDRIA
@ NPC_WARMAGE_ILSUDRIA
Definition
zone_crystalsong_forest.cpp:32
NPC_WARMAGE_SARINA
@ NPC_WARMAGE_SARINA
Definition
zone_crystalsong_forest.cpp:30
src
server
scripts
Northrend
zone_crystalsong_forest.cpp
Generated on
for Project SkyFire Core by
1.17.0