TrinityCore
Loading...
Searching...
No Matches
instance_razorfen_kraul.cpp
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18/* ScriptData
19SDName: Instance_Razorfen_Kraul
20SD%Complete:
21SDComment:
22SDCategory: Razorfen Kraul
23EndScriptData */
24
25#include "ScriptMgr.h"
26#include "GameObject.h"
27#include "InstanceScript.h"
28#include "Log.h"
29#include "Map.h"
30#include "Player.h"
31#include "razorfen_kraul.h"
32
33#define WARD_KEEPERS_NR 2
34
36{
37public:
39
44
46 {
52
55
57 {
58 Map::PlayerList const& players = instance->GetPlayers();
59 for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
60 {
61 if (Player* player = itr->GetSource())
62 return player;
63 }
64 TC_LOG_DEBUG("scripts", "Instance Razorfen Kraul: GetPlayerInMap, but PlayerList is empty!");
65 return nullptr;
66 }
67
68 void OnGameObjectCreate(GameObject* go) override
69 {
70 switch (go->GetEntry())
71 {
72 case 21099: DoorWardGUID = go->GetGUID(); break;
73 case 20920: go->SetFaction(FACTION_NONE); break; // big fat fugly hack
74 }
75 }
76
77 void Update(uint32 /*diff*/) override
78 {
81 {
82 go->ReplaceAllFlags(GO_FLAG_IN_USE | GO_FLAG_NODESPAWN);
83 go->SetGoState(GO_STATE_ACTIVE);
84 }
85 }
86
87 void SetData(uint32 type, uint32 /*data*/) override
88 {
89 switch (type)
90 {
92 }
93 }
94
95 };
96
97};
98
uint32_t uint32
Definition Define.h:133
#define TC_LOG_DEBUG(filterType__,...)
Definition Log.h:156
@ GO_FLAG_NODESPAWN
@ GO_FLAG_IN_USE
@ FACTION_NONE
@ GO_STATE_ACTIVE
#define DataHeader
void SetFaction(uint32 faction) override
Definition GameObject.h:286
InstanceMap * instance
void SetHeaders(std::string const &dataHeaders)
iterator end()
iterator begin()
GameObject * GetGameObject(ObjectGuid const &guid)
Definition Map.cpp:4430
PlayerList const & GetPlayers() const
Definition Map.h:448
uint32 GetEntry() const
Definition Object.h:81
static ObjectGuid GetGUID(Object const *o)
Definition Object.h:78
InstanceScript * GetInstanceScript(InstanceMap *map) const override
void AddSC_instance_razorfen_kraul()
#define WARD_KEEPERS_NR
#define EVENT_WARD_KEEPER
#define RFKScriptName