Project SkyFire Core
SkyFire 5.4.8 server core API documentation
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
7SDName: CrystalSongForest
8SDAuthor: Malcrom
9SD%Complete: 99%
10SDComment:
11SDCategory: CrystalsongForest
12Script Data End */
13
14#include "ScriptMgr.h"
15#include "ScriptedCreature.h"
16#include "Player.h"
17
18/*******************************************************
19 * npc_warmage_violetstand
20 *******************************************************/
21
26
34
36{
37public:
38 npc_warmage_violetstand() : CreatureScript("npc_warmage_violetstand") { }
39
41 {
43 {
44 SetCombatMovement(false);
45 }
46
48
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;
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)
84 uiTargetGUID = pOrb->GetGUID();
85 }
86
87 if (Creature* pOrb = me->GetCreature(*me, uiTargetGUID))
89 }
90 };
91
93 {
94 return new npc_warmage_violetstandAI(creature);
95 }
96};
97
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
std::uint64_t uint64
Definition Define.h:76
Creature * GetClosestCreatureWithEntry(WorldObject *source, uint32 entry, float maxSearchRange, bool alive)
void GetCreatureListWithEntryInGrid(std::list< Creature * > &list, WorldObject *source, uint32 entry, float maxSearchRange)
CreatureScript(const char *name)
void DoCast(uint32 spellId)
Definition UnitAI.cpp:110
CreatureAI * GetAI(Creature *creature) const OVERRIDE
void SetCombatMovement(bool allowMovement)
Creature * me
ScriptedAI(Creature *creature)
void UpdateAI(uint32) OVERRIDE
== Triggered Actions Requested ==================
@ SPELL_TRANSITUS_SHIELD_BEAM
@ NPC_TRANSITUS_SHIELD_DUMMY
@ SPELL_TRANSITUS_SHIELD_BEAM
void AddSC_crystalsong_forest()
@ NPC_TRANSITUS_SHIELD_DUMMY