forked from Watcher187/UWoWScripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwarmage.cpp
144 lines (130 loc) · 4.96 KB
/
warmage.cpp
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
#include "ScriptPCH.h"
class npc_warmage: public CreatureScript
{
public:
npc_warmage() : CreatureScript("npc_warmage") { }
bool OnGossipHello(Player* player, Creature *pCreature)
{
if (player->GetTeam() == ALLIANCE)
{
player->ADD_GOSSIP_ITEM( 10, "Slay Down the Warchief [RAID]" , GOSSIP_SENDER_MAIN, 3);
}
else // Main Menu for Horde
{
player->ADD_GOSSIP_ITEM( 10, "Slay Down the King [RAID]" , GOSSIP_SENDER_MAIN, 4);
}
player->ADD_GOSSIP_ITEM( 10, "Teleport me to the Battlefield" , GOSSIP_SENDER_MAIN, 1);
player->ADD_GOSSIP_ITEM( 10, "Teleport me to the Silver Blade" , GOSSIP_SENDER_MAIN, 2);
if (player->HasItemCount(1821, 1, true))
{
player->ADD_GOSSIP_ITEM( 10, "Valhalas Battle Arena" , GOSSIP_SENDER_MAIN, 5);
}
player->ADD_GOSSIP_ITEM( 10, "The Throne of the Elements" , GOSSIP_SENDER_MAIN, 6);
player->PlayerTalkClass->SendGossipMenu(55005,pCreature->GetGUID());
return true;
}
void SendDefaultMenu(Player* player, Creature* pCreature, uint32 uiAction)
{
if (player->isInCombat())
{
player->PlayerTalkClass->SendCloseGossip();
pCreature->MonsterSay("You are in combat!", LANG_UNIVERSAL, NULL);
return;
}
if (player->GetMap()->IsBattlegroundOrArena())
{
player->PlayerTalkClass->SendCloseGossip();
pCreature->MonsterSay("You cannot teleport while in battleground or Arena!", LANG_UNIVERSAL, NULL);
return;
}
switch(uiAction)
{
case 1: //Alliance Town
player->TeleportTo(571, 3582.155273f, 6627.647949f, 195.171249f, 1.372450f);
pCreature->MonsterWhisper("You have been teleported, now go speak with Raelorasz.", player->GetGUID());
break;
case 2: //Alliance Town
if (player->HasItemCount(19999, 1, true))
{
pCreature->MonsterWhisper("You have been teleported, now go speak with Talon.", player->GetGUID());
player->TeleportTo(571, 9088.542969f, 1245.036133f, 4.407508f, 5.394810f);
} else {
pCreature->MonsterWhisper("You require Glasses of the Mist to be in that area.", player->GetGUID());
player->PlayerTalkClass->SendCloseGossip();
}
break;
case 3: //Alliance Town
pCreature->MonsterWhisper("You have been teleported to Orgrimmar.", player->GetGUID());
player->TeleportTo(1, 1918.543091f, -4433.199707f, 24.809250f, 3.594606f);
break;
case 4: //Alliance Town
pCreature->MonsterWhisper("You have been teleported to Stormwind.", player->GetGUID());
player->TeleportTo(0, -8553.379883f, 597.395020f, 104.599960f, 5.414090f);
break;
case 5: //Valhalas
pCreature->MonsterWhisper("You have been teleported to Valhalas.", player->GetGUID());
player->TeleportTo(571, 8128.030273f, 3440.376953f, 672.371155f, 0.0759106f);
break;
case 6: //Valhalas
pCreature->MonsterWhisper("You have been teleported to the ancient Palace of the Elements.", player->GetGUID());
player->TeleportTo(13, -333.902008f, 18.739201f, 626.979004f, 3.911380f);
break;
}
}
bool OnGossipSelect(Player* player, Creature* pCreature, uint32 uiSender, uint32 uiAction)
{
player->PlayerTalkClass->ClearMenus();
if (uiSender == GOSSIP_SENDER_MAIN)
SendDefaultMenu(player, pCreature, uiAction);
return true;
}
};
class npc_tdtele: public CreatureScript
{
public:
npc_tdtele() : CreatureScript("npc_tdtele") { }
bool OnGossipHello(Player* player, Creature *pCreature)
{
player->ADD_GOSSIP_ITEM( 10, "Teleport to the Tower Defense!" , GOSSIP_SENDER_MAIN, 1);
player->ADD_GOSSIP_ITEM( 10, "Not right now." , GOSSIP_SENDER_MAIN, 2);
player->PlayerTalkClass->SendGossipMenu(55005,pCreature->GetGUID());
return true;
}
void SendDefaultMenu(Player* player, Creature* pCreature, uint32 uiAction)
{
if (player->isInCombat())
{
player->PlayerTalkClass->SendCloseGossip();
pCreature->MonsterSay("You are in combat!", LANG_UNIVERSAL, NULL);
return;
}
if (player->GetMap()->IsBattlegroundOrArena())
{
player->PlayerTalkClass->SendCloseGossip();
pCreature->MonsterSay("You cannot teleport while in battleground or Arena!", LANG_UNIVERSAL, NULL);
return;
}
switch(uiAction)
{
case 1: //Alliance Town
player->TeleportTo(429, -18.296444f, 472.577820f, -23.303589f, 0.056212f);
break;
case 2: //Alliance Town
player->PlayerTalkClass->SendCloseGossip();
pCreature->MonsterWhisper("Come back anytime when you wish to play!", player->GetGUID());
break;
}
}
bool OnGossipSelect(Player* player, Creature* pCreature, uint32 uiSender, uint32 uiAction)
{
player->PlayerTalkClass->ClearMenus();
if (uiSender == GOSSIP_SENDER_MAIN)
SendDefaultMenu(player, pCreature, uiAction);
return true;
}
};
void AddSC_npc_warmage()
{
new npc_tdtele();
new npc_warmage();
}