forked from scriptdev2/scriptdev2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathareatrigger_scripts.cpp
More file actions
150 lines (128 loc) · 4.37 KB
/
Copy pathareatrigger_scripts.cpp
File metadata and controls
150 lines (128 loc) · 4.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
/* Copyright (C) 2006 - 2011 ScriptDev2 <http://www.scriptdev2.com/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Areatrigger_Scripts
SD%Complete: 100
SDComment: Quest support: 6681, 10589/10604
SDCategory: Areatrigger
EndScriptData */
/* ContentData
at_coilfang_waterfall 4591
at_legion_teleporter 4560 Teleporter TO Invasion Point: Cataclysm
at_ravenholdt
at_childrens_week_spot 3546,3547,3548,3552,3549,3550
EndContentData */
#include "precompiled.h"
static uint32 TriggerOrphanSpell[6][3] =
{
{3546, 14305, 65056}, // The Bough of the Eternals
{3547, 14444, 65059}, // Lordaeron Throne Room
{3548, 14305, 65055}, // The Stonewrought Dam
{3549, 14444, 65058}, // Gateway to the Frontier
{3550, 14444, 65057}, // Down at the Docks
{3552, 14305, 65054} // Spooky Lighthouse
};
bool AreaTrigger_at_childrens_week_spot(Player* pPlayer, AreaTriggerEntry const* pAt)
{
for (uint8 i = 0; i < 6; ++i)
{
if (pAt->id == TriggerOrphanSpell[i][0] &&
pPlayer->GetMiniPet() && pPlayer->GetMiniPet()->GetEntry() == TriggerOrphanSpell[i][1])
{
pPlayer->CastSpell(pPlayer, TriggerOrphanSpell[i][2], true);
return true;
}
}
return false;
}
/*######
## at_coilfang_waterfall
######*/
enum
{
GO_COILFANG_WATERFALL = 184212
};
bool AreaTrigger_at_coilfang_waterfall(Player* pPlayer, AreaTriggerEntry const* pAt)
{
if (GameObject* pGo = GetClosestGameObjectWithEntry(pPlayer, GO_COILFANG_WATERFALL, 35.0f))
{
if (pGo->getLootState() == GO_READY)
pGo->UseDoorOrButton();
}
return false;
}
/*######
## at_legion_teleporter
######*/
enum
{
SPELL_TELE_A_TO = 37387,
QUEST_GAINING_ACCESS_A = 10589,
SPELL_TELE_H_TO = 37389,
QUEST_GAINING_ACCESS_H = 10604
};
bool AreaTrigger_at_legion_teleporter(Player* pPlayer, AreaTriggerEntry const* pAt)
{
if (pPlayer->isAlive() && !pPlayer->isInCombat())
{
if (pPlayer->GetTeam() == ALLIANCE && pPlayer->GetQuestRewardStatus(QUEST_GAINING_ACCESS_A))
{
pPlayer->CastSpell(pPlayer, SPELL_TELE_A_TO, false);
return true;
}
if (pPlayer->GetTeam() == HORDE && pPlayer->GetQuestRewardStatus(QUEST_GAINING_ACCESS_H))
{
pPlayer->CastSpell(pPlayer, SPELL_TELE_H_TO, false);
return true;
}
return false;
}
return false;
}
/*######
## at_ravenholdt
######*/
enum
{
QUEST_MANOR_RAVENHOLDT = 6681,
NPC_RAVENHOLDT = 13936
};
bool AreaTrigger_at_ravenholdt(Player* pPlayer, AreaTriggerEntry const* pAt)
{
if (pPlayer->GetQuestStatus(QUEST_MANOR_RAVENHOLDT) == QUEST_STATUS_INCOMPLETE)
pPlayer->KilledMonsterCredit(NPC_RAVENHOLDT);
return false;
}
void AddSC_areatrigger_scripts()
{
Script* pNewScript;
pNewScript = new Script;
pNewScript->Name = "at_childrens_week_spot";
pNewScript->pAreaTrigger = &AreaTrigger_at_childrens_week_spot;
pNewScript->RegisterSelf();
pNewScript = new Script;
pNewScript->Name = "at_coilfang_waterfall";
pNewScript->pAreaTrigger = &AreaTrigger_at_coilfang_waterfall;
pNewScript->RegisterSelf();
pNewScript = new Script;
pNewScript->Name = "at_legion_teleporter";
pNewScript->pAreaTrigger = &AreaTrigger_at_legion_teleporter;
pNewScript->RegisterSelf();
pNewScript = new Script;
pNewScript->Name = "at_ravenholdt";
pNewScript->pAreaTrigger = &AreaTrigger_at_ravenholdt;
pNewScript->RegisterSelf();
}