forked from insider42/scriptdev2
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgo_scripts.cpp
More file actions
507 lines (412 loc) · 13.5 KB
/
go_scripts.cpp
File metadata and controls
507 lines (412 loc) · 13.5 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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
/* Copyright (C) 2006 - 2010 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* 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: 4285,4287,4288(crystal pylons), 4296, 5088, 6481, 10990, 10991, 10992. Field_Repair_Bot->Teaches spell 22704. Barov_journal->Teaches spell 26089
SDCategory: Game Objects
EndScriptData */
/* ContentData
go_cat_figurine (the "trap" version of GO, two different exist)
go_northern_crystal_pylon
go_eastern_crystal_pylon
go_western_crystal_pylon
go_barov_journal
go_ethereum_prison
go_ethereum_stasis
go_field_repair_bot_74A
go_orb_of_command
go_resonite_cask
go_sacred_fire_of_life
go_shrine_of_the_birds
go_tablet_of_madness
go_tablet_of_the_seven
go_tele_to_dalaran_crystal
go_tele_to_violet_stand
EndContentData */
#include "precompiled.h"
/*######
## go_cat_figurine
######*/
enum
{
SPELL_SUMMON_GHOST_SABER = 5968,
};
bool GOHello_go_cat_figurine(Player* pPlayer, GameObject* pGo)
{
pPlayer->CastSpell(pPlayer,SPELL_SUMMON_GHOST_SABER,true);
return false;
}
/*######
## go_crystal_pylons (3x)
######*/
bool GOHello_go_northern_crystal_pylon(Player* pPlayer, GameObject* pGo)
{
if (pGo->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER)
{
pPlayer->PrepareQuestMenu(pGo->GetGUID());
pPlayer->SendPreparedQuest(pGo->GetGUID());
}
if (pPlayer->GetQuestStatus(4285) == QUEST_STATUS_INCOMPLETE)
pPlayer->AreaExploredOrEventHappens(4285);
return true;
}
bool GOHello_go_eastern_crystal_pylon(Player* pPlayer, GameObject* pGo)
{
if (pGo->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER)
{
pPlayer->PrepareQuestMenu(pGo->GetGUID());
pPlayer->SendPreparedQuest(pGo->GetGUID());
}
if (pPlayer->GetQuestStatus(4287) == QUEST_STATUS_INCOMPLETE)
pPlayer->AreaExploredOrEventHappens(4287);
return true;
}
bool GOHello_go_western_crystal_pylon(Player* pPlayer, GameObject* pGo)
{
if (pGo->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER)
{
pPlayer->PrepareQuestMenu(pGo->GetGUID());
pPlayer->SendPreparedQuest(pGo->GetGUID());
}
if (pPlayer->GetQuestStatus(4288) == QUEST_STATUS_INCOMPLETE)
pPlayer->AreaExploredOrEventHappens(4288);
return true;
}
/*######
## go_barov_journal
######*/
bool GOHello_go_barov_journal(Player* pPlayer, GameObject* pGo)
{
if (pPlayer->HasSkill(SKILL_TAILORING) && pPlayer->GetBaseSkillValue(SKILL_TAILORING) >= 280 && !pPlayer->HasSpell(26086))
{
pPlayer->CastSpell(pPlayer,26095,false);
}
return true;
}
/*######
## go_ethereum_prison
######*/
enum
{
SPELL_REP_LC = 39456,
SPELL_REP_SHAT = 39457,
SPELL_REP_CE = 39460,
SPELL_REP_CON = 39474,
SPELL_REP_KT = 39475,
SPELL_REP_SPOR = 39476
};
const uint32 uiNpcPrisonEntry[] =
{
22810, 22811, 22812, 22813, 22814, 22815, //good guys
20783, 20784, 20785, 20786, 20788, 20789, 20790 //bad guys
};
bool GOHello_go_ethereum_prison(Player* pPlayer, GameObject* pGo)
{
int iRandom = rand() % (sizeof(uiNpcPrisonEntry) / sizeof(uint32));
if (Creature* pCreature = pPlayer->SummonCreature(uiNpcPrisonEntry[iRandom],
pGo->GetPositionX(), pGo->GetPositionY(), pGo->GetPositionZ(), pGo->GetAngle(pPlayer),
TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000))
{
if (!pCreature->IsHostileTo(pPlayer))
{
uint32 uiSpell = 0;
if (FactionTemplateEntry const* pFaction = pCreature->getFactionTemplateEntry())
{
switch(pFaction->faction)
{
case 1011: uiSpell = SPELL_REP_LC; break;
case 935: uiSpell = SPELL_REP_SHAT; break;
case 942: uiSpell = SPELL_REP_CE; break;
case 933: uiSpell = SPELL_REP_CON; break;
case 989: uiSpell = SPELL_REP_KT; break;
case 970: uiSpell = SPELL_REP_SPOR; break;
}
if (uiSpell)
pCreature->CastSpell(pPlayer,uiSpell,false);
else
error_log("SD2: go_ethereum_prison summoned creature (entry %u) but faction (%u) are not expected by script.",pCreature->GetEntry(),pCreature->getFaction());
}
}
}
return false;
}
/*######
## go_ethereum_stasis
######*/
const uint32 uiNpcStasisEntry[] =
{
22825, 20888, 22827, 22826, 22828
};
bool GOHello_go_ethereum_stasis(Player* pPlayer, GameObject* pGo)
{
int iRandom = rand() % (sizeof(uiNpcStasisEntry) / sizeof(uint32));
pPlayer->SummonCreature(uiNpcStasisEntry[iRandom],
pGo->GetPositionX(), pGo->GetPositionY(), pGo->GetPositionZ(), pGo->GetAngle(pPlayer),
TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
return false;
}
/*######
## go_field_repair_bot_74A
######*/
bool GOHello_go_field_repair_bot_74A(Player* pPlayer, GameObject* pGo)
{
if (pPlayer->HasSkill(SKILL_ENGINERING) && pPlayer->GetBaseSkillValue(SKILL_ENGINERING) >= 300 && !pPlayer->HasSpell(22704))
{
pPlayer->CastSpell(pPlayer,22864,false);
}
return true;
}
/*######
## go_gilded_brazier
######*/
enum
{
NPC_STILLBLADE = 17716,
};
bool GOHello_go_gilded_brazier(Player* pPlayer, GameObject* pGO)
{
if (pGO->GetGoType() == GAMEOBJECT_TYPE_GOOBER)
{
if (Creature* pCreature = pPlayer->SummonCreature(NPC_STILLBLADE, 8087.632f, -7542.740f, 151.568f, 0.122f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000))
pCreature->AI()->AttackStart(pPlayer);
}
return true;
}
/*######
## go_jump_a_tron
######*/
enum
{
SPELL_JUMP_A_TRON = 33382,
NPC_JUMP_A_TRON = 19041
};
bool GOHello_go_jump_a_tron(Player* pPlayer, GameObject* pGo)
{
if (Creature* pCreature = GetClosestCreatureWithEntry(pGo, NPC_JUMP_A_TRON, INTERACTION_DISTANCE))
pCreature->CastSpell(pPlayer, SPELL_JUMP_A_TRON, false);
return false;
}
/*######
## go_orb_of_command
######*/
bool GOHello_go_orb_of_command(Player* pPlayer, GameObject* pGo)
{
if (pPlayer->GetQuestRewardStatus(7761))
pPlayer->CastSpell(pPlayer,23460,true);
return true;
}
/*######
## go_resonite_cask
######*/
enum
{
NPC_GOGGEROC = 11920
};
bool GOHello_go_resonite_cask(Player* pPlayer, GameObject* pGO)
{
if (pGO->GetGoType() == GAMEOBJECT_TYPE_GOOBER)
pGO->SummonCreature(NPC_GOGGEROC, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 300000);
return false;
}
/*######
## go_sacred_fire_of_life
######*/
enum
{
NPC_ARIKARA = 10882,
};
bool GOHello_go_sacred_fire_of_life(Player* pPlayer, GameObject* pGO)
{
if (pGO->GetGoType() == GAMEOBJECT_TYPE_GOOBER)
pPlayer->SummonCreature(NPC_ARIKARA, -5008.338f, -2118.894f, 83.657f, 0.874f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
return true;
}
/*######
## go_shrine_of_the_birds
######*/
enum
{
NPC_HAWK_GUARD = 22992,
NPC_EAGLE_GUARD = 22993,
NPC_FALCON_GUARD = 22994,
GO_SHRINE_HAWK = 185551,
GO_SHRINE_EAGLE = 185547,
GO_SHRINE_FALCON = 185553
};
bool GOHello_go_shrine_of_the_birds(Player* pPlayer, GameObject* pGo)
{
uint32 uiBirdEntry = 0;
float fX,fY,fZ;
pGo->GetClosePoint(fX, fY, fZ, pGo->GetObjectBoundingRadius(), INTERACTION_DISTANCE);
switch(pGo->GetEntry())
{
case GO_SHRINE_HAWK:
uiBirdEntry = NPC_HAWK_GUARD;
break;
case GO_SHRINE_EAGLE:
uiBirdEntry = NPC_EAGLE_GUARD;
break;
case GO_SHRINE_FALCON:
uiBirdEntry = NPC_FALCON_GUARD;
break;
}
if (uiBirdEntry)
pPlayer->SummonCreature(uiBirdEntry, fX, fY, fZ, pGo->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
return false;
}
/*######
## go_tablet_of_madness
######*/
bool GOHello_go_tablet_of_madness(Player* pPlayer, GameObject* pGo)
{
if (pPlayer->HasSkill(SKILL_ALCHEMY) && pPlayer->GetSkillValue(SKILL_ALCHEMY) >= 300 && !pPlayer->HasSpell(24266))
{
pPlayer->CastSpell(pPlayer,24267,false);
}
return true;
}
/*######
## go_tablet_of_the_seven
######*/
//TODO: use gossip option ("Transcript the Tablet") instead, if Mangos adds support.
bool GOHello_go_tablet_of_the_seven(Player* pPlayer, GameObject* pGo)
{
if (pGo->GetGoType() != GAMEOBJECT_TYPE_QUESTGIVER)
return true;
if (pPlayer->GetQuestStatus(4296) == QUEST_STATUS_INCOMPLETE)
pPlayer->CastSpell(pPlayer,15065,false);
return true;
}
/*######
## go_tele_to_dalaran_crystal
######*/
enum
{
QUEST_LEARN_LEAVE_RETURN = 12790,
QUEST_TELE_CRYSTAL_FLAG = 12845
};
bool GOHello_go_tele_to_dalaran_crystal(Player* pPlayer, GameObject* pGo)
{
if (pPlayer->GetQuestRewardStatus(QUEST_TELE_CRYSTAL_FLAG))
return false;
//TODO: must send error message (what kind of message? On-screen?)
return true;
}
/*######
## go_tele_to_violet_stand
######*/
bool GOHello_go_tele_to_violet_stand(Player* pPlayer, GameObject* pGo)
{
if (pPlayer->GetQuestRewardStatus(QUEST_LEARN_LEAVE_RETURN) || pPlayer->GetQuestStatus(QUEST_LEARN_LEAVE_RETURN) == QUEST_STATUS_INCOMPLETE)
return false;
return true;
}
enum
{
NPC_ZELEMAR_THE_WRATHFULL = 17830,
SAY_AGGRO = -1000579
};
float Position[4] = {-327.99f, 221.74f, -20.31f, 3.87f};
bool GOHello_go_blood_filled_orb(Player* pPlayer, GameObject* pGo)
{
if (Creature* pZelemar = pGo->SummonCreature(NPC_ZELEMAR_THE_WRATHFULL, Position[0], Position[1], Position[2], Position[3], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000))
{
DoScriptText(SAY_AGGRO, pZelemar);
pZelemar->AI()->AttackStart(pPlayer);
}
return false;
}
void AddSC_go_scripts()
{
Script *newscript;
newscript = new Script;
newscript->Name = "go_cat_figurine";
newscript->pGOHello = &GOHello_go_cat_figurine;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "go_northern_crystal_pylon";
newscript->pGOHello = &GOHello_go_northern_crystal_pylon;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "go_eastern_crystal_pylon";
newscript->pGOHello = &GOHello_go_eastern_crystal_pylon;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "go_western_crystal_pylon";
newscript->pGOHello = &GOHello_go_western_crystal_pylon;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "go_barov_journal";
newscript->pGOHello = &GOHello_go_barov_journal;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "go_ethereum_prison";
newscript->pGOHello = &GOHello_go_ethereum_prison;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "go_ethereum_stasis";
newscript->pGOHello = &GOHello_go_ethereum_stasis;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "go_field_repair_bot_74A";
newscript->pGOHello = &GOHello_go_field_repair_bot_74A;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "go_gilded_brazier";
newscript->pGOHello = &GOHello_go_gilded_brazier;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "go_jump_a_tron";
newscript->pGOHello = &GOHello_go_jump_a_tron;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "go_orb_of_command";
newscript->pGOHello = &GOHello_go_orb_of_command;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "go_resonite_cask";
newscript->pGOHello = &GOHello_go_resonite_cask;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "go_sacred_fire_of_life";
newscript->pGOHello = &GOHello_go_sacred_fire_of_life;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "go_shrine_of_the_birds";
newscript->pGOHello = &GOHello_go_shrine_of_the_birds;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "go_tablet_of_madness";
newscript->pGOHello = &GOHello_go_tablet_of_madness;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "go_tablet_of_the_seven";
newscript->pGOHello = &GOHello_go_tablet_of_the_seven;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "go_tele_to_dalaran_crystal";
newscript->pGOHello = &GOHello_go_tele_to_dalaran_crystal;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "go_tele_to_violet_stand";
newscript->pGOHello = &GOHello_go_tele_to_violet_stand;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "go_blood_filled_orb";
newscript->pGOHello = &GOHello_go_blood_filled_orb;
newscript->RegisterSelf();
}