TrinityCore
Loading...
Searching...
No Matches
zone_felwood.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
19
SDName: Felwood
20
SD%Complete: 95
21
SDComment: Quest support: 7632
22
SDCategory: Felwood
23
EndScriptData */
24
25
/* ContentData
26
at_ancient_leaf
27
EndContentData */
28
29
#include "
ScriptMgr.h
"
30
#include "
Map.h
"
31
#include "
Player.h
"
32
#include "
ScriptedCreature.h
"
33
#include "
ScriptedGossip.h
"
34
35
/*######
36
## at_ancient_leaf
37
######*/
38
39
enum
AncientMisc
40
{
41
QUEST_ANCIENT_LEAF
= 7632,
42
NPC_VARTRUS
= 14524,
43
NPC_STOMA
= 14525,
44
NPC_HASTAT
= 14526,
45
CREATURE_GROUP_ANCIENTS
= 1
46
};
47
48
class
at_ancient_leaf
:
public
AreaTriggerScript
49
{
50
public
:
51
at_ancient_leaf
() :
AreaTriggerScript
(
"at_ancient_leaf"
) { }
52
53
bool
OnTrigger
(
Player
* player,
AreaTriggerEntry
const
*
/*trigger*/
)
override
54
{
55
if
(player->
IsGameMaster
() || !player->
IsAlive
())
56
return
false
;
57
58
// Handle Call Ancients event start - The area trigger summons 3 ancients
59
if
((player->
GetQuestStatus
(
QUEST_ANCIENT_LEAF
) ==
QUEST_STATUS_COMPLETE
) || (player->
GetQuestStatus
(
QUEST_ANCIENT_LEAF
) ==
QUEST_STATUS_REWARDED
))
60
{
61
// If ancients are already spawned, skip the rest
62
if
(
GetClosestCreatureWithEntry
(player,
NPC_VARTRUS
, 50.0f) ||
GetClosestCreatureWithEntry
(player,
NPC_STOMA
, 50.0f) ||
GetClosestCreatureWithEntry
(player,
NPC_HASTAT
, 50.0f))
63
return
true
;
64
65
player->
GetMap
()->
SummonCreatureGroup
(
CREATURE_GROUP_ANCIENTS
);
66
}
67
return
false
;
68
}
69
};
70
71
void
AddSC_felwood
()
72
{
73
new
at_ancient_leaf
();
74
}
Map.h
Player.h
QUEST_STATUS_REWARDED
@ QUEST_STATUS_REWARDED
Definition
QuestDef.h:110
QUEST_STATUS_COMPLETE
@ QUEST_STATUS_COMPLETE
Definition
QuestDef.h:105
ScriptMgr.h
ScriptedCreature.h
GetClosestCreatureWithEntry
Creature * GetClosestCreatureWithEntry(WorldObject *source, uint32 entry, float maxSearchRange, bool alive=true)
Definition
ScriptedCreature.h:388
ScriptedGossip.h
AreaTriggerScript
Definition
ScriptMgr.h:427
Map::SummonCreatureGroup
void SummonCreatureGroup(uint8 group, std::list< TempSummon * > *list=nullptr)
Definition
Object.cpp:1959
Player
Definition
Player.h:924
Player::IsGameMaster
bool IsGameMaster() const
Definition
Player.h:998
Player::GetQuestStatus
QuestStatus GetQuestStatus(uint32 quest_id) const
Definition
Player.cpp:15642
Unit::IsAlive
bool IsAlive() const
Definition
Unit.h:1234
WorldObject::GetMap
Map * GetMap() const
Definition
Object.h:449
at_ancient_leaf
Definition
zone_felwood.cpp:49
at_ancient_leaf::at_ancient_leaf
at_ancient_leaf()
Definition
zone_felwood.cpp:51
at_ancient_leaf::OnTrigger
bool OnTrigger(Player *player, AreaTriggerEntry const *) override
Definition
zone_felwood.cpp:53
AreaTriggerEntry
Definition
DBCStructure.h:227
AddSC_felwood
void AddSC_felwood()
Definition
zone_felwood.cpp:71
AncientMisc
AncientMisc
Definition
zone_felwood.cpp:40
CREATURE_GROUP_ANCIENTS
@ CREATURE_GROUP_ANCIENTS
Definition
zone_felwood.cpp:45
NPC_VARTRUS
@ NPC_VARTRUS
Definition
zone_felwood.cpp:42
QUEST_ANCIENT_LEAF
@ QUEST_ANCIENT_LEAF
Definition
zone_felwood.cpp:41
NPC_STOMA
@ NPC_STOMA
Definition
zone_felwood.cpp:43
NPC_HASTAT
@ NPC_HASTAT
Definition
zone_felwood.cpp:44
server
scripts
Kalimdor
zone_felwood.cpp
Generated on Sun May 10 2026 02:30:21 for TrinityCore by
1.9.8