Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
uldaman.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: Uldaman
8SD%Complete: 100
9SDComment: Quest support: 2240, 2278 + 1 trash mob.
10SDCategory: Uldaman
11EndScriptData */
12
13/* ContentData
14npc_jadespine_basilisk
15go_keystone_chamber
16at_map_chamber
17EndContentData */
18
19#include "ScriptMgr.h"
20#include "ScriptedCreature.h"
21#include "uldaman.h"
22#include "Player.h"
23
24/*######
25## npc_jadespine_basilisk
26######*/
27
32
34{
35public:
37 : CreatureScript("npc_jadespine_basilisk") { }
38
40 {
41 npc_jadespine_basiliskAI(Creature* creature) : ScriptedAI(creature) { }
42
44
46 {
47 uiCslumberTimer = 2000;
48 }
49
50 void EnterCombat(Unit* /*who*/) OVERRIDE { }
51
53 {
54 //Return since we have no target
55 if (!UpdateVictim())
56 return;
57
58 //uiCslumberTimer
59 if (uiCslumberTimer <= uiDiff)
60 {
61 //Cast
63
64 //Stop attacking target thast asleep and pick new target
65 uiCslumberTimer = 28000;
66
68
69 if (!target || target == me->GetVictim())
70 target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
71
72 if (target)
73 me->TauntApply(target);
74
75 } else uiCslumberTimer -= uiDiff;
76
78 }
79 };
80
82 {
83 return new npc_jadespine_basiliskAI(creature);
84 }
85};
86
87/*######
88## go_keystone_chamber
89######*/
90
92{
93public:
94 go_keystone_chamber() : GameObjectScript("go_keystone_chamber") { }
95
96 bool OnGossipHello(Player* /*player*/, GameObject* go) OVERRIDE
97 {
98 if (InstanceScript* instance = go->GetInstanceScript())
99 instance->SetData(DATA_IRONAYA_SEAL, IN_PROGRESS); //door animation and save state.
100
101 return false;
102 }
103};
104
105/*######
106## at_map_chamber
107######*/
108
109#define QUEST_HIDDEN_CHAMBER 2240
110
112{
113public:
115
116 bool OnTrigger(Player* player, AreaTriggerEntry const* /*trigger*/) OVERRIDE
117 {
118 if (player->GetQuestStatus(QUEST_HIDDEN_CHAMBER) == QUEST_STATUS_INCOMPLETE)
119 player->AreaExploredOrEventHappens(QUEST_HIDDEN_CHAMBER);
120
121 return true;
122 }
123};
124
131
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ IN_PROGRESS
@ QUEST_STATUS_INCOMPLETE
Definition QuestDef.h:89
@ SELECT_TARGET_TOPAGGRO
Definition UnitAI.h:24
@ SELECT_TARGET_RANDOM
Definition UnitAI.h:23
bool OnTrigger(Player *player, AreaTriggerEntry const *) OVERRIDE
Definition uldaman.cpp:116
AreaTriggerScript(const char *name)
bool UpdateVictim()
CreatureScript(const char *name)
GameObjectScript(const char *name)
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:28
Unit * SelectTarget(SelectAggroTarget targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, int32 aura=0)
Definition UnitAI.cpp:66
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:168
Definition Unit.h:1367
bool OnGossipHello(Player *, GameObject *go) OVERRIDE
Definition uldaman.cpp:96
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition uldaman.cpp:81
Creature * me
ScriptedAI(Creature *creature)
void UpdateAI(uint32 uiDiff) OVERRIDE
== Triggered Actions Requested ==================
Definition uldaman.cpp:52
@ SPELL_CRYSTALLINE_SLUMBER
Definition uldaman.cpp:30
#define QUEST_HIDDEN_CHAMBER
Definition uldaman.cpp:109
void AddSC_uldaman()
Definition uldaman.cpp:125
@ DATA_IRONAYA_SEAL
Definition uldaman.h:18