TrinityCore
zone_orderhall_warrior.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#include "Containers.h"
19#include "MotionMaster.h"
20#include "MovementTypedefs.h"
21#include "ObjectAccessor.h"
22#include "PhasingHandler.h"
23#include "Player.h"
24#include "ScriptedCreature.h"
25#include "ScriptMgr.h"
26#include "TemporarySummon.h"
27
29{
33};
34
36{
37 PHASE_ODYN = 5107,
38 PHASE_DANICA = 5090
39};
40
42{
44};
45
47{
51};
52
54{
59 ITEM_HOV_SHIELD_2 = 137265
60};
61
63{
64 npc_danica_the_reclaimer(Creature* creature) : ScriptedAI(creature) { }
65
67 {
68 { 1050.219f, 7232.470f, 100.5846f },
69 { 1046.207f, 7240.372f, 100.5846f },
70 { 1040.963f, 7245.498f, 100.6819f },
71 { 1034.726f, 7250.083f, 100.5846f },
72 { 1027.422f, 7257.835f, 100.5846f },
73 { 1027.542f, 7259.735f, 100.5846f }
74 };
75
76 using DanicaPath01Size = std::extent<decltype(DanicaPath01)>;
77
79 {
80 { 1018.493f, 7247.438f, 100.5846f },
81 { 1013.535f, 7243.327f, 100.5846f },
82 { 1007.063f, 7235.723f, 100.5846f },
83 { 1003.337f, 7229.650f, 100.5846f },
84 { 995.4549f, 7227.286f, 100.5846f },
85 { 984.4410f, 7224.357f, 100.5846f }
86 };
87
88 using DanicaPath02Size = std::extent<decltype(DanicaPath02)>;
89
91 {
92 { 962.5208f, 7223.089f, 100.5846f },
93 { 934.2795f, 7223.116f, 100.5846f },
94 { 911.8507f, 7223.776f, 100.5846f },
95 { 879.0139f, 7224.100f, 100.9079f },
96 { 851.691f, 7224.5490f, 109.5846f }
97 };
98
99 using DanicaPath03Size = std::extent<decltype(DanicaPath03)>;
100
101 enum Texts
102 {
106 };
107
109 {
113 };
114
115 // Should be the player
116 // Personal spawn ? Demon Creator is the player who accepts the quest, no phasing involved but the quest giver dissapears and gets replaced with a new one
117 void IsSummonedBy(WorldObject* summoner) override
118 {
119 if (summoner->GetTypeId() != TYPEID_PLAYER)
120 return;
121
123 _summonerGuid = summoner->GetGUID();
124 _scheduler.Schedule(2s, [this, summoner](TaskContext /*context*/)
125 {
126 me->GetMotionMaster()->MoveSmoothPath(POINT_FORGE_OF_ODYN, DanicaPath01, DanicaPath01Size::value, false, true);
127 Talk(SAY_FIRST_LINE, summoner);
128 });
129 }
130
131 void MovementInform(uint32 /*type*/, uint32 id) override
132 {
133 switch (id)
134 {
136 _scheduler.Schedule(10s, [this](TaskContext /*context*/)
137 {
139 me->GetMotionMaster()->MoveSmoothPath(POINT_INTRODUCE_MEAD_HALL, DanicaPath02, DanicaPath02Size::value, false, true);
140 Talk(SAY_SECOND_LINE, player);
141 });
142 break;
144 _scheduler.Schedule(10s, [this](TaskContext /*context*/)
145 {
147 me->GetMotionMaster()->MoveSmoothPath(POINT_ODYN, DanicaPath03, DanicaPath03Size::value, false, true);
148 Talk(SAY_THIRD_LINE, player);
149
150 if (player)
152 });
153 break;
154 case POINT_ODYN:
156 break;
157 default:
158 break;
159 }
160 }
161
162 void UpdateAI(uint32 diff) override
163 {
164 _scheduler.Update(diff);
165 }
166
167 // Should be some other way to do this...
168 void OnQuestAccept(Player* player, Quest const* /*quest*/) override
169 {
170 TempSummon* summon = player->SummonCreature(NPC_DANICA_THE_RECLAIMER, 1059.613f, 7224.605f, 100.4608f, 0.03462749f, TEMPSUMMON_MANUAL_DESPAWN, 0s, player->GetGUID());
171 if (!summon)
172 return;
173
174 summon->SetDemonCreatorGUID(player->GetGUID());
175 }
176
177private:
180};
181
183{
187
189 {
191 };
192
193 void UpdateAI(uint32 diff) override
194 {
195 _scheduler.Update(diff);
196 }
197
198 void Reset() override
199 {
200 _scheduler.Schedule(5s, 30s, [this](TaskContext context)
201 {
203 if (emoteID == EMOTE_ONESHOT_EAT_NO_SHEATHE)
204 {
206 _scheduler.Schedule(1s, [this](TaskContext /*context*/)
207 {
208 me->SetVirtualItem(0, 0);
209 if (roll_chance_i(85))
211 });
212 }
213
214 me->HandleEmoteCommand(emoteID);
215 context.Repeat();
216 });
217
218 _scheduler.Schedule(5min, 20min, [this](TaskContext /*context*/)
219 {
220 float direction = me->GetOrientation() + M_PI;
222 });
223 }
224
225 void MovementInform(uint32 /*type*/, uint32 id) override
226 {
227 switch (id)
228 {
229 case POINT_LEAVING:
231 break;
232 default:
233 break;
234 }
235 }
236
237private:
239 std::unordered_set<Emote> _randomEmotes;
240};
241
243{
246
248 {
252 };
253
254 virtual size_t GetPathToTableSize() const = 0;
255 virtual Position const* GetPathToTable() const = 0;
256 virtual size_t GetPathToOdynSize() const = 0;
257 virtual Position const* GetPathToOdyn() const = 0;
258 virtual size_t GetPathToDespawnPointSize() const = 0;
259 virtual Position const* GetPathToDespawnPoint() const = 0;
260
261 void Reset() override
262 {
264 }
265
266 void UpdateAI(uint32 diff) override
267 {
268 _scheduler.Update(diff);
269 }
270
271 void MovementInform(uint32 /*type*/, uint32 id) override
272 {
273 switch (id)
274 {
275 case POINT_TABLE:
276 _scheduler.Schedule(3s, 6s, [this](TaskContext /*context*/)
277 {
279 });
280
281 _scheduler.Schedule(7s, 15s, [this](TaskContext /*context*/)
282 {
283 me->GetMotionMaster()->MoveSmoothPath(POINT_ODYN, GetPathToOdyn(), GetPathToOdynSize(), true);
284 });
285 break;
286 case POINT_ODYN:
287 _scheduler.Schedule(1s, 3s, [this](TaskContext /*context*/)
288 {
290 _scheduler.Schedule(3s, 10s, [this](TaskContext /*context*/)
291 {
293 });
294 });
295 break;
296 case POINT_DESPAWN:
298 break;
299 default:
300 break;
301 }
302 }
303
304private:
306 std::unordered_set<Emote> _randomEmotes;
307};
308
310{
312
314 {
315 { 876.7396f, 7220.805f, 98.91662f },
316 { 870.6129f, 7220.945f, 101.8951f },
317 { 865.0677f, 7220.975f, 103.7846f },
318 { 854.6389f, 7221.030f, 106.7846f },
319 { 851.1597f, 7220.292f, 106.7846f },
320 { 848.0573f, 7216.386f, 106.7846f },
321 { 844.7570f, 7210.920f, 106.7846f },
322 { 841.9844f, 7207.228f, 106.7846f },
323 { 839.2396f, 7203.619f, 107.5846f },
324 { 836.4844f, 7200.202f, 107.5846f },
325 { 834.2430f, 7196.000f, 107.5846f }
326 };
327
329
331 {
332 { 828.5851f, 7204.096f, 106.7846f },
333 { 819.4636f, 7212.124f, 106.7846f },
334 { 814.2853f, 7215.074f, 106.7846f },
335 { 809.4948f, 7217.543f, 106.7846f },
336 { 806.0313f, 7219.614f, 106.7846f }
337 };
338
340
342 {
343 { 824.1597f, 7221.822f, 106.7846f },
344 { 831.7500f, 7221.092f, 106.7846f },
345 { 842.4236f, 7222.208f, 106.7846f },
346 { 853.5781f, 7222.473f, 106.7846f },
347 { 863.9618f, 7223.012f, 103.7846f },
348 { 867.9358f, 7223.165f, 103.3735f },
349 { 880.6215f, 7222.569f, 97.78457f },
350 { 887.8438f, 7221.310f, 97.78457f },
351 { 903.7118f, 7215.743f, 97.78458f }
352 };
353
355
356 size_t GetPathToTableSize() const override { return IncommingValarjarAspirantPath01Size::value; }
357 Position const* GetPathToTable() const override { return IncommingValarjarAspirantPath01; }
358 size_t GetPathToOdynSize() const override { return IncommingValarjarAspirantPath02Size::value; }
359 Position const* GetPathToOdyn() const override { return IncommingValarjarAspirantPath02; }
360 size_t GetPathToDespawnPointSize() const override { return IncommingValarjarAspirantPath03Size::value; }
362};
363
365{
367
369 {
370 { 890.5521f, 7235.710f, 97.78457f },
371 { 883.8073f, 7233.402f, 97.78457f },
372 { 872.1979f, 7234.018f, 101.2886f },
373 { 863.5941f, 7234.594f, 103.7846f },
374 { 855.2899f, 7235.626f, 106.7593f },
375 { 849.8177f, 7236.571f, 106.7846f },
376 { 845.7830f, 7241.082f, 106.7846f },
377 { 841.8489f, 7246.654f, 106.7846f },
378 { 839.7205f, 7250.986f, 106.7846f },
379 { 840.8889f, 7254.773f, 107.5846f },
380 { 841.9254f, 7259.517f, 107.5846f },
381 { 840.6077f, 7266.662f, 107.5846f }
382 };
383
385
387 {
388 { 838.1493f, 7260.027f, 107.5846f },
389 { 832.2691f, 7253.756f, 106.7846f },
390 { 823.1996f, 7246.677f, 106.7846f },
391 { 821.2500f, 7244.573f, 106.7846f },
392 { 815.8906f, 7241.437f, 106.7846f },
393 { 809.8281f, 7239.580f, 106.7846f }
394 };
395
397
399 {
400 { 827.4757f, 7236.593f, 106.7846f },
401 { 837.1840f, 7236.047f, 106.7846f },
402 { 847.1684f, 7235.377f, 106.7846f },
403 { 854.7185f, 7235.294f, 106.7846f },
404 { 862.3524f, 7234.287f, 104.4290f },
405 { 882.3489f, 7233.743f, 97.78457f },
406 { 894.3768f, 7233.098f, 97.78457f },
407 { 906.0660f, 7232.520f, 97.78458f },
408 { 915.0070f, 7233.368f, 97.78458f },
409 { 924.6910f, 7233.694f, 97.78458f }
410 };
411
413
414 size_t GetPathToTableSize() const override { return IncommingValarjarAspirantPath01Size::value; }
415 Position const* GetPathToTable() const override { return IncommingValarjarAspirantPath01; }
416 size_t GetPathToOdynSize() const override { return IncommingValarjarAspirantPath02Size::value; }
417 Position const* GetPathToOdyn() const override { return IncommingValarjarAspirantPath02; }
418 size_t GetPathToDespawnPointSize() const override { return IncommingValarjarAspirantPath03Size::value; }
420};
421
423{
425
427 {
428 { 802.5903f, 7304.605f, 106.7846f },
429 { 809.3333f, 7296.529f, 106.7846f },
430 { 811.8004f, 7293.676f, 106.7846f },
431 { 817.4219f, 7287.498f, 106.7846f },
432 { 821.0313f, 7283.637f, 106.7846f },
433 { 822.1111f, 7275.672f, 106.7846f },
434 { 826.4662f, 7270.601f, 107.5846f },
435 { 830.8212f, 7268.729f, 107.5846f }
436 };
437
438 using PathLeavingValarjar01Size = std::extent<decltype(PathLeavingValarjar01)>;
439
441 {
442 { 824.9757f, 7261.047f, 107.5846f },
443 { 822.0989f, 7256.705f, 106.7846f },
444 { 819.0261f, 7253.674f, 106.7846f },
445 { 813.1910f, 7249.034f, 106.7846f },
446 { 809.1493f, 7245.616f, 106.7846f },
447 { 806.3559f, 7243.057f, 106.7846f }
448 };
449
450 using PathLeavingValarjar02Size = std::extent<decltype(PathLeavingValarjar02)>;
451
453 {
454 { 825.3177f, 7244.253f, 106.7846f },
455 { 837.5816f, 7243.241f, 106.7846f },
456 { 845.0243f, 7240.063f, 106.7846f },
457 { 853.7274f, 7238.423f, 106.7953f },
458 { 862.9948f, 7238.000f, 103.9737f },
459 { 872.7899f, 7236.939f, 100.8285f },
460 { 882.8333f, 7235.922f, 97.78457f },
461 { 897.2813f, 7235.469f, 97.78457f },
462 { 908.8090f, 7234.836f, 97.78458f },
463 { 919.8750f, 7238.241f, 97.78458f }
464 };
465
466 using PathLeavingValarjar03Size = std::extent<decltype(PathLeavingValarjar03)>;
467
468 size_t GetPathToTableSize() const override { return PathLeavingValarjar01Size::value; }
469 Position const* GetPathToTable() const override { return PathLeavingValarjar01; }
470 size_t GetPathToOdynSize() const override { return PathLeavingValarjar02Size::value; }
471 Position const* GetPathToOdyn() const override { return PathLeavingValarjar02; }
472 size_t GetPathToDespawnPointSize() const override { return PathLeavingValarjar03Size::value; }
473 Position const* GetPathToDespawnPoint() const override { return PathLeavingValarjar03; }
474};
475
477{
479
481 {
482 { 787.2361f, 7155.902f, 107.5846f },
483 { 792.4844f, 7154.038f, 106.7846f },
484 { 798.7830f, 7154.968f, 106.7846f },
485 { 807.8160f, 7162.251f, 106.7846f },
486 { 813.2882f, 7167.856f, 106.7846f },
487 { 816.4913f, 7170.818f, 106.7846f },
488 { 819.8299f, 7166.373f, 107.6281f }
489 };
490
491 using PathLeavingValarjar01Size = std::extent<decltype(PathLeavingValarjar01)>;
492
494 {
495 { 818.2708f, 7175.469f, 106.7846f },
496 { 819.5643f, 7185.691f, 106.7846f },
497 { 818.4184f, 7193.082f, 106.7846f },
498 { 818.8750f, 7199.256f, 106.7846f },
499 { 815.2361f, 7203.648f, 106.7846f },
500 { 809.6198f, 7208.319f, 106.7846f },
501 { 804.2743f, 7215.379f, 106.7846f }
502 };
503
504 using PathLeavingValarjar02Size = std::extent<decltype(PathLeavingValarjar02)>;
505
507 {
508 { 810.8403f, 7231.531f, 106.7846f },
509 { 807.5087f, 7248.719f, 106.7846f },
510 { 801.2587f, 7254.592f, 106.7846f },
511 { 794.6649f, 7265.814f, 107.5846f },
512 { 792.0191f, 7274.151f, 107.5846f },
513 { 790.1823f, 7282.182f, 107.5846f }
514 };
515
516 using PathLeavingValarjar03Size = std::extent<decltype(PathLeavingValarjar03)>;
517
518 size_t GetPathToTableSize() const override { return PathLeavingValarjar01Size::value; }
519 Position const* GetPathToTable() const override { return PathLeavingValarjar01; }
520 size_t GetPathToOdynSize() const override { return PathLeavingValarjar02Size::value; }
521 Position const* GetPathToOdyn() const override { return PathLeavingValarjar02; }
522 size_t GetPathToDespawnPointSize() const override { return PathLeavingValarjar03Size::value; }
523 Position const* GetPathToDespawnPoint() const override { return PathLeavingValarjar03; }
524};
525
526struct npc_odyn : public ScriptedAI
527{
528 npc_odyn(Creature* creature) : ScriptedAI(creature) { }
529
530 // Should be an better way of doing this...
531 // What about a QuestScript with a hook "OnPlayerChangeArea" ? But The Great Mead Hall does not have a specific area...
532 void MoveInLineOfSight(Unit* who) override
533 {
534 if (Player* player = who->ToPlayer())
535 {
536 if (player->GetQuestStatus(QUEST_ODYN_AND_THE_VALARJAR) == QUEST_STATUS_INCOMPLETE)
537 {
538 if (player->IsInDist(me, 60.0f))
539 {
540 player->KilledMonsterCredit(NPC_KILL_CREDIT_ARRIVED_AT_ODYN); // SPELL_WARRIOR_ORDER_FORMATION_SCENE does not has this credit.
541 player->CastSpell(player, SPELL_WARRIOR_ORDER_FORMATION_SCENE);
542 }
543 }
544 }
545 }
546};
547
549{
552
553 void UpdateAI(uint32 diff) override
554 {
555 _scheduler.Update(diff);
556 }
557
558 void Reset() override
559 {
560 _scheduler.Schedule(5s, 30s, [this](TaskContext context)
561 {
563 context.Repeat();
564 });
565
566 _scheduler.Schedule(5min, 20min, [this](TaskContext /*context*/)
567 {
568 float direction = me->GetOrientation() + M_PI;
569 me->GetMotionMaster()->MovePoint(0, me->GetFirstCollisionPosition(5.0f, direction));
570 });
571 }
572
573 void MovementInform(uint32 /*type*/, uint32 id) override
574 {
575 switch (id)
576 {
577 case 0:
579 break;
580 default:
581 break;
582 }
583 }
584
585private:
587 std::unordered_set<Emote> _randomEmotes;
588};
589
591{
592 npc_valkyr_of_odyn(Creature* creature) : ScriptedAI(creature) { }
593
594 virtual Position const* GetPath() const = 0;
595 virtual size_t GetPathSize() const = 0;
596
598 {
602 };
603
604 void Reset() override
605 {
606 if (me->GetPositionZ() >= 100.0f)
607 {
608 _scheduler.Schedule(3s, [this](TaskContext /*context*/)
609 {
610 me->GetMotionMaster()->MoveSmoothPath(POINT_JUMP, GetPath(), GetPathSize(), false, true);
611 });
612 }
613 else
615 }
616
617 void UpdateAI(uint32 diff) override
618 {
619 _scheduler.Update(diff);
620 }
621
622 void MovementInform(uint32 /*type*/, uint32 id) override
623 {
624 switch (id)
625 {
626 case POINT_JUMP:
627 _scheduler.Schedule(250ms, [this](TaskContext /*context*/)
628 {
629 /*
630 * (MovementMonsterSpline) (MovementSpline) MoveTime: 3111
631 * (MovementMonsterSpline) (MovementSpline) JumpGravity: 19.2911 -> +-Movement::gravity
632 * 1.4125f is guessed value. Which makes the JumpGravity way closer to the intended one. Not sure how to do it 100% blizzlike.
633 * Also the MoveTime is not correct but I don't know how to set it here.
634 */
635 me->GetMotionMaster()->MoveJump({ 1107.84f, 7222.57f, 38.9725f, me->GetOrientation() }, me->GetSpeed(MOVE_RUN), Movement::gravity * 1.4125f, POINT_DESPAWN_JUMP);
636 });
637 break;
638 case POINT_DESPAWN:
639 me->DespawnOrUnsummon(500ms);
640 break;
643 break;
644 default:
645 break;
646 }
647 }
648
649private:
651};
652
654{
656
657 Position const Path[7] =
658 {
659 { 996.5347f, 7321.393f, 124.0931f },
660 { 1009.880f, 7311.655f, 118.0898f },
661 { 1024.688f, 7293.689f, 120.4009f },
662 { 1038.288f, 7266.321f, 122.2708f },
663 { 1049.439f, 7235.418f, 120.1065f },
664 { 1067.825f, 7229.589f, 114.6320f },
665 { 1082.800f, 7223.660f, 98.63562f }
666 };
667
668 using PathSize = std::extent<decltype(Path)>;
669
670 Position const* GetPath() const override { return Path; }
671 size_t GetPathSize() const override { return PathSize::value; }
672};
673
675{
677
678 Position const Path[18] =
679 {
680 { 1113.635f, 7214.023f, 7.808200f },
681 { 1110.443f, 7213.999f, 17.28479f },
682 { 1108.583f, 7213.984f, 22.80371f },
683 { 1103.488f, 7221.702f, 70.68047f },
684 { 1101.911f, 7222.535f, 82.51234f },
685 { 1098.861f, 7222.271f, 90.03111f },
686 { 1095.129f, 7223.033f, 94.15130f },
687 { 1089.240f, 7223.335f, 97.94925f },
688 { 1077.932f, 7222.822f, 110.2143f },
689 { 1068.802f, 7223.216f, 110.2143f },
690 { 1045.356f, 7224.674f, 114.5371f },
691 { 1023.946f, 7224.304f, 120.0150f },
692 { 1002.535f, 7224.943f, 121.1011f },
693 { 911.7552f, 7227.165f, 121.7384f },
694 { 879.1285f, 7227.272f, 121.7384f },
695 { 830.8785f, 7233.613f, 121.7384f },
696 { 809.5052f, 7267.270f, 121.7384f },
697 { 795.2899f, 7311.849f, 121.7384f }
698 };
699
700 using PathSize = std::extent<decltype(Path)>;
701
702 Position const* GetPath() const override { return Path; }
703 size_t GetPathSize() const override { return PathSize::value; }
704};
705
707{
709
710 Position const Path[14] =
711 {
712 { 1133.929f, 7223.167f, 38.90330f },
713 { 1124.510f, 7222.310f, 42.15336f },
714 { 1119.903f, 7221.891f, 43.74335f },
715 { 1103.934f, 7227.212f, 69.99904f },
716 { 1097.554f, 7226.132f, 89.09371f },
717 { 1092.602f, 7224.059f, 101.1545f },
718 { 1078.701f, 7228.348f, 109.5599f },
719 { 1068.967f, 7232.247f, 116.7876f },
720 { 1053.540f, 7229.623f, 117.8927f },
721 { 1044.104f, 7242.757f, 118.7891f },
722 { 1031.111f, 7256.717f, 118.7891f },
723 { 1029.684f, 7288.019f, 126.3048f },
724 { 1029.889f, 7325.333f, 126.3061f },
725 { 1039.043f, 7365.176f, 133.2310f }
726 };
727
728 using PathSize = std::extent<decltype(Path)>;
729
730 Position const* GetPath() const override { return Path; }
731 size_t GetPathSize() const override { return PathSize::value; }
732};
733
735{
737
738 Position const Path[7] =
739 {
740 { 914.8663f, 7204.922f, 128.1687f },
741 { 945.4445f, 7216.170f, 128.1687f },
742 { 987.2483f, 7220.554f, 125.4318f },
743 { 1015.882f, 7222.849f, 126.0546f },
744 { 1053.023f, 7224.076f, 119.6729f },
745 { 1071.891f, 7222.934f, 108.9545f },
746 { 1081.530f, 7224.331f, 98.63076f }
747 };
748
749 using PathSize = std::extent<decltype(Path)>;
750
751 Position const* GetPath() const override { return Path; }
752 size_t GetPathSize() const override { return PathSize::value; }
753};
754
756{
758
759 Position const Path[12] =
760 {
761 { 1038.141f, 7134.033f, 105.8965f },
762 { 1033.373f, 7134.492f, 105.8965f },
763 { 1027.882f, 7136.373f, 105.8965f },
764 { 1026.943f, 7144.288f, 105.8965f },
765 { 1027.608f, 7167.030f, 108.4167f },
766 { 1027.767f, 7180.922f, 108.4167f },
767 { 1028.484f, 7197.977f, 108.4167f },
768 { 1034.113f, 7207.747f, 108.4167f },
769 { 1041.977f, 7216.452f, 108.4167f },
770 { 1054.269f, 7223.207f, 108.4167f },
771 { 1075.891f, 7224.811f, 101.7954f },
772 { 1082.438f, 7224.540f, 99.12900f }
773 };
774
775 using PathSize = std::extent<decltype(Path)>;
776
777 Position const* GetPath() const override { return Path; }
778 size_t GetPathSize() const override { return PathSize::value; }
779};
780
782{
784
785 Position const Path[17] =
786 {
787 { 1112.011f, 7233.799f, 45.87240f },
788 { 1107.887f, 7234.073f, 54.97818f },
789 { 1106.264f, 7234.181f, 58.56218f },
790 { 1099.969f, 7236.397f, 75.87664f },
791 { 1096.552f, 7233.196f, 85.53920f },
792 { 1095.531f, 7229.387f, 89.86687f },
793 { 1092.981f, 7225.366f, 97.69602f },
794 { 1082.800f, 7221.249f, 109.4660f },
795 { 1070.983f, 7218.749f, 112.6827f },
796 { 1057.455f, 7216.709f, 112.6827f },
797 { 1051.859f, 7210.338f, 112.6827f },
798 { 1042.427f, 7200.762f, 112.6827f },
799 { 1032.616f, 7183.982f, 112.6827f },
800 { 1027.792f, 7157.764f, 112.6827f },
801 { 1026.870f, 7126.981f, 112.6827f },
802 { 1053.083f, 7102.808f, 125.9283f },
803 { 1055.122f, 7059.807f, 130.4395f }
804 };
805
806 using PathSize = std::extent<decltype(Path)>;
807
808 Position const* GetPath() const override { return Path; }
809 size_t GetPathSize() const override { return PathSize::value; }
810};
811
813{
815
816 Position const Path[10] =
817 {
818 { 1064.076f, 7305.979f, 117.5428f },
819 { 1058.290f, 7305.543f, 117.5428f },
820 { 1046.578f, 7305.583f, 117.5428f },
821 { 1034.373f, 7295.979f, 117.5428f },
822 { 1026.639f, 7275.582f, 114.1900f },
823 { 1030.729f, 7251.381f, 114.1900f },
824 { 1040.950f, 7237.213f, 114.1900f },
825 { 1057.274f, 7229.228f, 114.1900f },
826 { 1070.297f, 7226.421f, 111.7502f },
827 { 1082.146f, 7225.846f, 101.0798f }
828 };
829
830 using PathSize = std::extent<decltype(Path)>;
831
832 Position const* GetPath() const override { return Path; }
833 size_t GetPathSize() const override { return PathSize::value; }
834};
835
837{
840
841 void UpdateAI(uint32 diff) override
842 {
843 _scheduler.Update(diff);
844 }
845
846 void Reset() override
847 {
848 _scheduler.Schedule(15s, 20s, [this](TaskContext context)
849 {
850 me->SetAIAnimKitId(0);
851 std::pair<uint32, uint32> weapons = Trinity::Containers::SelectRandomContainerElement(_randomWeapons);
852 me->SetVirtualItem(0, weapons.first);
853 me->SetVirtualItem(1, weapons.second);
854
855 context.Schedule(8s, 10s, [this](TaskContext context)
856 {
857 me->SetVirtualItem(0, 0);
858 me->SetVirtualItem(1, 0);
859 context.Schedule(10s, [this](TaskContext /*context*/)
860 {
861 me->SetAIAnimKitId(1583);
862 });
863 });
864
865 context.Repeat(30s);
866 });
867 }
868
869private:
871 std::unordered_set<std::pair<uint32, uint32>> _randomWeapons;
872};
873
875{
876public:
877 scene_odyn_intro() : SceneScript("scene_odyn_intro") { }
878
879 void OnSceneStart(Player* player, uint32 /*sceneInstanceID*/, SceneTemplate const* /*sceneTemplate*/) override
880 {
883 player->SetControlled(true, UNIT_STATE_ROOT);
884 }
885
886 // Called when a scene is canceled
887 void OnSceneCancel(Player* player, uint32 /*sceneInstanceID*/, SceneTemplate const* /*sceneTemplate*/) override
888 {
889 Finish(player);
890 }
891
892 // Called when a scene is completed
893 void OnSceneComplete(Player* player, uint32 /*sceneInstanceID*/, SceneTemplate const* /*sceneTemplate*/) override
894 {
895 Finish(player);
896 }
897
898 void Finish(Player* player)
899 {
901 player->SetControlled(false, UNIT_STATE_ROOT);
903 }
904};
905
907{
924 new scene_odyn_intro();
925}
#define M_PI
Definition: Common.h:115
uint32_t uint32
Definition: Define.h:142
@ TEMPSUMMON_MANUAL_DESPAWN
Definition: ObjectDefines.h:70
@ TYPEID_PLAYER
Definition: ObjectGuid.h:41
@ QUEST_STATUS_INCOMPLETE
Definition: QuestDef.h:145
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:42
bool roll_chance_i(int chance)
Definition: Random.h:59
#define RegisterCreatureAI(ai_name)
Definition: ScriptMgr.h:1380
Emote
@ EMOTE_ONESHOT_CHEER_NO_SHEATHE
@ EMOTE_ONESHOT_LAUGH_NO_SHEATHE
@ EMOTE_ONESHOT_NO
@ EMOTE_ONESHOT_POINT
@ EMOTE_ONESHOT_LAUGH
@ EMOTE_ONESHOT_ROAR
@ EMOTE_ONESHOT_SALUTE
@ EMOTE_ONESHOT_EAT_NO_SHEATHE
@ EMOTE_ONESHOT_SHOUT
@ EMOTE_ONESHOT_TALK
@ MOVE_RUN
Definition: UnitDefines.h:118
@ UNIT_NPC_FLAG_GOSSIP
Definition: UnitDefines.h:297
@ UNIT_STATE_ROOT
Definition: Unit.h:265
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:56
Creature *const me
Definition: CreatureAI.h:61
void DespawnOrUnsummon(Milliseconds timeToDespawn=0s, Seconds forceRespawnTime=0s)
Definition: Creature.cpp:2415
void MoveSmoothPath(uint32 pointId, Position const *pathPoints, size_t pathSize, bool walk=false, bool fly=false)
void MovePoint(uint32 id, Position const &pos, bool generatePath=true, Optional< float > finalOrient={}, Optional< float > speed={}, MovementWalkRunSpeedSelectionMode speedSelectionMode=MovementWalkRunSpeedSelectionMode::Default, Optional< float > closeEnoughDistance={})
TypeID GetTypeId() const
Definition: Object.h:173
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:159
static Player * ToPlayer(Object *o)
Definition: Object.h:213
static void AddPhase(WorldObject *object, uint32 phaseId, bool updateVisibility)
static void RemovePhase(WorldObject *object, uint32 phaseId, bool updateVisibility)
void KilledMonsterCredit(uint32 entry, ObjectGuid guid=ObjectGuid::Empty)
Definition: Player.cpp:16680
TaskContext & Schedule(std::chrono::duration< Rep, Period > time, TaskScheduler::task_handler_t task)
TaskContext & Repeat(std::chrono::duration< Rep, Period > duration)
TaskScheduler & Schedule(std::chrono::duration< Rep, Period > time, task_handler_t task)
TaskScheduler & Update(success_t const &callback=nullptr)
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.h:159
Definition: Unit.h:627
void SetVirtualItem(uint32 slot, uint32 itemId, uint16 appearanceModId=0, uint16 itemVisual=0)
Definition: Unit.cpp:13604
float GetSpeed(UnitMoveType mtype) const
Definition: Unit.cpp:8515
void SetControlled(bool apply, UnitState state)
Definition: Unit.cpp:10911
void PlayOneShotAnimKitId(uint16 animKitId)
Definition: Unit.cpp:10529
MotionMaster * GetMotionMaster()
Definition: Unit.h:1652
void SetDemonCreatorGUID(ObjectGuid guid)
Definition: Unit.h:1183
void RemoveNpcFlag(NPCFlags flags)
Definition: Unit.h:983
void HandleEmoteCommand(Emote emoteId, Player *target=nullptr, Trinity::IteratorPair< int32 const * > spellVisualKitIds={}, int32 sequenceVariation=0)
Definition: Unit.cpp:1598
void SetAIAnimKitId(uint16 animKitId)
Definition: Unit.cpp:10543
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition: Object.cpp:2896
TempSummon * SummonCreature(uint32 entry, Position const &pos, TempSummonType despawnType=TEMPSUMMON_MANUAL_DESPAWN, Milliseconds despawnTime=0s, uint32 vehId=0, uint32 spellId=0, ObjectGuid privateObjectOwner=ObjectGuid::Empty)
Definition: Object.cpp:2025
Position GetFirstCollisionPosition(float dist, float angle)
Definition: Object.cpp:3416
void Finish(Player *player)
void OnSceneComplete(Player *player, uint32, SceneTemplate const *) override
void OnSceneCancel(Player *player, uint32, SceneTemplate const *) override
void OnSceneStart(Player *player, uint32, SceneTemplate const *) override
float constexpr gravity
TC_GAME_API Player * FindConnectedPlayer(ObjectGuid const &)
auto SelectRandomContainerElement(C const &container) -> typename std::add_const< decltype(*std::begin(container))>::type &
Definition: Containers.h:109
constexpr float GetOrientation() const
Definition: Position.h:79
constexpr float GetPositionZ() const
Definition: Position.h:78
std::extent< decltype(DanicaPath01)> DanicaPath01Size
std::extent< decltype(DanicaPath03)> DanicaPath03Size
std::extent< decltype(DanicaPath02)> DanicaPath02Size
void UpdateAI(uint32 diff) override
void IsSummonedBy(WorldObject *summoner) override
void OnQuestAccept(Player *player, Quest const *) override
void MovementInform(uint32, uint32 id) override
npc_danica_the_reclaimer(Creature *creature)
std::unordered_set< Emote > _randomEmotes
void UpdateAI(uint32 diff) override
npc_feasting_valarjar(Creature *creature)
void MovementInform(uint32, uint32 id) override
Position const * GetPathToTable() const override
npc_incoming_valarjar_aspirant_1(Creature *creature)
std::extent< decltype(IncommingValarjarAspirantPath02)> IncommingValarjarAspirantPath02Size
Position const * GetPathToDespawnPoint() const override
Position const * GetPathToOdyn() const override
size_t GetPathToDespawnPointSize() const override
std::extent< decltype(IncommingValarjarAspirantPath01)> IncommingValarjarAspirantPath01Size
std::extent< decltype(IncommingValarjarAspirantPath03)> IncommingValarjarAspirantPath03Size
size_t GetPathToDespawnPointSize() const override
std::extent< decltype(IncommingValarjarAspirantPath03)> IncommingValarjarAspirantPath03Size
Position const * GetPathToOdyn() const override
std::extent< decltype(IncommingValarjarAspirantPath01)> IncommingValarjarAspirantPath01Size
Position const * GetPathToTable() const override
Position const * GetPathToDespawnPoint() const override
npc_incoming_valarjar_aspirant_2(Creature *creature)
std::extent< decltype(IncommingValarjarAspirantPath02)> IncommingValarjarAspirantPath02Size
size_t GetPathToOdynSize() const override
npc_leaving_valarjar_1(Creature *creature)
Position const * GetPathToDespawnPoint() const override
Position const * GetPathToTable() const override
Position const PathLeavingValarjar02[6]
Position const PathLeavingValarjar03[10]
std::extent< decltype(PathLeavingValarjar03)> PathLeavingValarjar03Size
std::extent< decltype(PathLeavingValarjar01)> PathLeavingValarjar01Size
std::extent< decltype(PathLeavingValarjar02)> PathLeavingValarjar02Size
size_t GetPathToTableSize() const override
Position const PathLeavingValarjar01[8]
Position const * GetPathToOdyn() const override
size_t GetPathToDespawnPointSize() const override
Position const * GetPathToDespawnPoint() const override
Position const * GetPathToTable() const override
std::extent< decltype(PathLeavingValarjar01)> PathLeavingValarjar01Size
Position const PathLeavingValarjar01[7]
std::extent< decltype(PathLeavingValarjar02)> PathLeavingValarjar02Size
std::extent< decltype(PathLeavingValarjar03)> PathLeavingValarjar03Size
Position const PathLeavingValarjar03[6]
Position const PathLeavingValarjar02[7]
npc_leaving_valarjar_2(Creature *creature)
size_t GetPathToDespawnPointSize() const override
size_t GetPathToTableSize() const override
size_t GetPathToOdynSize() const override
Position const * GetPathToOdyn() const override
void MoveInLineOfSight(Unit *who) override
npc_odyn(Creature *creature)
void UpdateAI(uint32 diff) override
void MovementInform(uint32, uint32 id) override
std::unordered_set< Emote > _randomEmotes
npc_spectating_valarjar(Creature *creature)
virtual Position const * GetPathToTable() const =0
virtual size_t GetPathToTableSize() const =0
virtual size_t GetPathToOdynSize() const =0
virtual size_t GetPathToDespawnPointSize() const =0
virtual Position const * GetPathToDespawnPoint() const =0
void MovementInform(uint32, uint32 id) override
virtual Position const * GetPathToOdyn() const =0
npc_valkyr_of_odyn_1(Creature *creature)
Position const * GetPath() const override
size_t GetPathSize() const override
std::extent< decltype(Path)> PathSize
std::extent< decltype(Path)> PathSize
size_t GetPathSize() const override
Position const * GetPath() const override
npc_valkyr_of_odyn_2(Creature *creature)
npc_valkyr_of_odyn_3(Creature *creature)
std::extent< decltype(Path)> PathSize
Position const * GetPath() const override
size_t GetPathSize() const override
npc_valkyr_of_odyn_4(Creature *creature)
std::extent< decltype(Path)> PathSize
size_t GetPathSize() const override
Position const * GetPath() const override
Position const * GetPath() const override
size_t GetPathSize() const override
std::extent< decltype(Path)> PathSize
npc_valkyr_of_odyn_5(Creature *creature)
Position const * GetPath() const override
size_t GetPathSize() const override
std::extent< decltype(Path)> PathSize
npc_valkyr_of_odyn_6(Creature *creature)
size_t GetPathSize() const override
std::extent< decltype(Path)> PathSize
Position const * GetPath() const override
npc_valkyr_of_odyn_7(Creature *creature)
virtual Position const * GetPath() const =0
void MovementInform(uint32, uint32 id) override
void UpdateAI(uint32 diff) override
virtual size_t GetPathSize() const =0
npc_valkyr_of_odyn(Creature *creature)
std::unordered_set< std::pair< uint32, uint32 > > _randomWeapons
npc_weapon_inspector_valarjar(Creature *creature)
void UpdateAI(uint32 diff) override
@ SPELL_CANCEL_COMPLETE_SCENE_WARRIOR_ORDER_FORMATION
@ SPELL_WARRIOR_ORDER_FORMATION_SCENE
@ SPELL_EMOTE_BELCH
@ NPC_DANICA_THE_RECLAIMER
@ NPC_KILL_CREDIT_FOLLOWED_DANICA
@ NPC_KILL_CREDIT_ARRIVED_AT_ODYN
void AddSC_orderhall_warrior()
@ QUEST_ODYN_AND_THE_VALARJAR
@ ITEM_MONSTER_ITEM_MUTTON_WITH_BITE
@ ITEM_HOV_SHIELD_2
@ ITEM_HOV_1H_SWORD
@ ITEM_MONSTER_ITEM_TANKARD_WOODEN