-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathgo_scripts.cpp
More file actions
99 lines (87 loc) · 3.24 KB
/
go_scripts.cpp
File metadata and controls
99 lines (87 loc) · 3.24 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
/* This file is part of the ScriptDev2 Project. See AUTHORS file for Copyright information
* 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: GO_Scripts
SD%Complete: 100
SDComment: Quest support: 5097, 5098, 10990, 10991, 10992, Barov_journal->Teaches spell 26089
SDCategory: Game Objects
EndScriptData */
/* ContentData
go_barov_journal
go_andorhal_tower
EndContentData */
#include "precompiled.h"
/*######
## go_barov_journal
######*/
enum
{
SPELL_TAILOR_FELCLOTH_BAG = 26086,
SPELL_LEARN_FELCLOTH_BAG = 26095
};
bool GOUse_go_barov_journal(Player* pPlayer, GameObject* /*pGo*/)
{
if (pPlayer->HasSkill(SKILL_TAILORING) && pPlayer->GetBaseSkillValue(SKILL_TAILORING) >= 280 && !pPlayer->HasSpell(SPELL_TAILOR_FELCLOTH_BAG))
{
pPlayer->CastSpell(pPlayer, SPELL_LEARN_FELCLOTH_BAG, false);
}
return true;
}
/*######
## go_andorhal_tower
######*/
enum
{
QUEST_ALL_ALONG_THE_WATCHTOWERS_ALLIANCE = 5097,
QUEST_ALL_ALONG_THE_WATCHTOWERS_HORDE = 5098,
NPC_ANDORHAL_TOWER_1 = 10902,
NPC_ANDORHAL_TOWER_2 = 10903,
NPC_ANDORHAL_TOWER_3 = 10904,
NPC_ANDORHAL_TOWER_4 = 10905,
GO_ANDORHAL_TOWER_1 = 176094,
GO_ANDORHAL_TOWER_2 = 176095,
GO_ANDORHAL_TOWER_3 = 176096,
GO_ANDORHAL_TOWER_4 = 176097
};
bool GOUse_go_andorhal_tower(Player* pPlayer, GameObject* pGo)
{
if (pPlayer->GetQuestStatus(QUEST_ALL_ALONG_THE_WATCHTOWERS_ALLIANCE) == QUEST_STATUS_INCOMPLETE || pPlayer->GetQuestStatus(QUEST_ALL_ALONG_THE_WATCHTOWERS_HORDE) == QUEST_STATUS_INCOMPLETE)
{
uint32 uiKillCredit = 0;
switch (pGo->GetEntry())
{
case GO_ANDORHAL_TOWER_1: uiKillCredit = NPC_ANDORHAL_TOWER_1; break;
case GO_ANDORHAL_TOWER_2: uiKillCredit = NPC_ANDORHAL_TOWER_2; break;
case GO_ANDORHAL_TOWER_3: uiKillCredit = NPC_ANDORHAL_TOWER_3; break;
case GO_ANDORHAL_TOWER_4: uiKillCredit = NPC_ANDORHAL_TOWER_4; break;
}
if (uiKillCredit)
pPlayer->KilledMonsterCredit(uiKillCredit);
}
return true;
}
void AddSC_go_scripts()
{
Script* pNewScript;
pNewScript = new Script;
pNewScript->Name = "go_barov_journal";
pNewScript->pGOUse = &GOUse_go_barov_journal;
pNewScript->RegisterSelf();
pNewScript = new Script;
pNewScript->Name = "go_andorhal_tower";
pNewScript->pGOUse = &GOUse_go_andorhal_tower;
pNewScript->RegisterSelf();
}