TrinityCore
Loading...
Searching...
No Matches
brewfest.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 "ScriptMgr.h"
19#include "CreatureAIImpl.h"
20#include "Player.h"
21#include "SpellAuraEffects.h"
22#include "SpellScript.h"
23#include "World.h"
24
44
45// 42924 - Giddyup!
47{
49
50 void OnChange(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
51 {
52 Unit* target = GetTarget();
54 {
55 target->RemoveAura(GetId());
56 return;
57 }
58
59 if (target->HasAura(SPELL_EXHAUSTED_RAM))
60 return;
61
62 switch (GetStackAmount())
63 {
64 case 1: // green
67 target->CastSpell(target, SPELL_RAM_TROT, true);
68 break;
69 case 6: // yellow
72 target->CastSpell(target, SPELL_RAM_CANTER, true);
73 break;
74 case 11: // red
76 target->CastSpell(target, SPELL_RAM_GALLOP, true);
77 break;
78 default:
79 break;
80 }
81
82 if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_DEFAULT)
83 {
85 target->CastSpell(target, SPELL_RAM_LEVEL_NEUTRAL, true);
86 }
87 }
88
89 void OnPeriodic(AuraEffect const* /*aurEff*/)
90 {
92 }
93
100};
101
102// 43310 - Ram Level - Neutral
103// 42992 - Ram - Trot
104// 42993 - Ram - Canter
105// 42994 - Ram - Gallop
107{
109
110 void OnPeriodic(AuraEffect const* aurEff)
111 {
112 Unit* target = GetTarget();
113 if (target->HasAura(SPELL_EXHAUSTED_RAM))
114 return;
115
116 switch (GetId())
117 {
119 if (Aura* aura = target->GetAura(SPELL_RAM_FATIGUE))
120 aura->ModStackAmount(-4);
121 break;
122 case SPELL_RAM_TROT: // green
123 if (Aura* aura = target->GetAura(SPELL_RAM_FATIGUE))
124 aura->ModStackAmount(-2);
125 if (aurEff->GetTickNumber() == 4)
127 break;
128 case SPELL_RAM_CANTER:
129 {
132 target->CastSpell(target, SPELL_RAM_FATIGUE, args);
133 if (aurEff->GetTickNumber() == 8)
135 break;
136 }
137 case SPELL_RAM_GALLOP:
138 {
140 args.AddSpellMod(SPELLVALUE_AURA_STACK, target->HasAura(SPELL_RAM_FATIGUE) ? 4 : 5 /*Hack*/);
141 target->CastSpell(target, SPELL_RAM_FATIGUE, args);
142 if (aurEff->GetTickNumber() == 8)
143 target->CastSpell(target, SPELL_BREWFEST_QUEST_SPEED_BUNNY_RED, true);
144 break;
145 }
146 default:
147 break;
148 }
149
150 }
151
156};
157
158// 43052 - Ram Fatigue
184
185// 43450 - Brewfest - apple trap - friendly DND
200
201// 43332 - Exhausted Ram
217
218// 43714 - Brewfest - Relay Race - Intro - Force - Player to throw- DND
220{
222
224 {
225 PreventHitDefaultEffect(effIndex);
226 // All this spells trigger a spell that requires reagents; if the
227 // triggered spell is cast as "triggered", reagents are not consumed
229 }
230
235};
236
237// 43755 - Brewfest - Daily - Relay Race - Player - Increase Mount Duration - DND
258
259// 43876 - Dismount Ram
274
276{
277 // Horde
280
281 // Alliance
284
285 // Bark for Drohn's Distillery!
290
291 // Bark for T'chali's Voodoo Brewery!
296
297 // Bark for the Barleybrews!
302
303 // Bark for the Thunderbrews!
307 SAY_THUNDERBREWS_4 = 22942
309
310// 43259 Brewfest - Barker Bunny 1
311// 43260 Brewfest - Barker Bunny 2
312// 43261 Brewfest - Barker Bunny 3
313// 43262 Brewfest - Barker Bunny 4
315{
317
318 bool Load() override
319 {
320 return GetUnitOwner()->GetTypeId() == TYPEID_PLAYER;
321 }
322
348
353};
354
364
365// 49357 - Brewfest Mount Transformation
366// 52845 - Brewfest Mount Transformation (Faction Swap)
368{
370
371 bool Validate(SpellInfo const* /*spell*/) override
372 {
373 return ValidateSpellInfo(
374 {
379 });
380 }
381
382 void HandleDummy(SpellEffIndex /* effIndex */)
383 {
384 Player* caster = GetCaster()->ToPlayer();
385 if (caster->HasAuraType(SPELL_AURA_MOUNTED))
386 {
388 uint32 spell_id;
389
390 switch (GetSpellInfo()->Id)
391 {
393 if (caster->GetSpeedRate(MOVE_RUN) >= 2.0f)
394 spell_id = caster->GetTeam() == ALLIANCE ? SPELL_MOUNT_RAM_100 : SPELL_MOUNT_KODO_100;
395 else
396 spell_id = caster->GetTeam() == ALLIANCE ? SPELL_MOUNT_RAM_60 : SPELL_MOUNT_KODO_60;
397 break;
399 if (caster->GetSpeedRate(MOVE_RUN) >= 2.0f)
400 spell_id = caster->GetTeam() == HORDE ? SPELL_MOUNT_RAM_100 : SPELL_MOUNT_KODO_100;
401 else
402 spell_id = caster->GetTeam() == HORDE ? SPELL_MOUNT_RAM_60 : SPELL_MOUNT_KODO_60;
403 break;
404 default:
405 return;
406 }
407 caster->CastSpell(caster, spell_id, true);
408 }
409 }
410
415};
416
417/*
418 Brew of the Month
419 January [Wild Winter Pilsner]
420 spell_brewfest_botm_the_beast_within
421 February [Izzard's Ever Flavor]
422 spell_brewfest_botm_gassy
423 March [Aromatic Honey Brew]
424 Nothing to script here
425 April [Metok's Bubble Bock]
426 spell_brewfest_botm_bloated
427 Incomplete (spells 49828, 49827, 49830, 49837)
428 May [Springtime Stout]
429 Nothing to script here
430 June [Blackrock Lager]
431 spell_brewfest_botm_internal_combustion
432 July [Stranglethorn Brew]
433 spell_brewfest_botm_jungle_madness
434 August [Draenic Pale Ale]
435 spell_brewfest_botm_pink_elekk
436 September [Binary Brew]
437 spell_brewfest_botm_teach_language
438 October [Autumnal Acorn Ale]
439 Nothing to script here
440 November [Bartlett's Bitter Brew]
441 spell_brewfest_botm_nauseous
442 Incomplete
443 December [Lord of Frost's Private Label]
444 Nothing to script here
445*/
446
451
452// 50098 - The Beast Within
472
477
478// 49864 - Gassy
498
503
504// 49822 - Bloated
524
529
530// 49738 - Internal Combustion
550
555
556// 49962 - Jungle Madness!
576
581
582// 42264 - Weak Alcohol
584{
586
587 bool Validate(SpellInfo const* /*spellInfo*/) override
588 {
590 }
591
593 {
594 // TODO: Needs additional research, this spell is most likely used if drunk state is high enough.
595 if (roll_chance_i(50))
597 }
598
603};
604
610
611// 50243 - Teach Language
613{
615
616 bool Validate(SpellInfo const* /*spellInfo*/) override
617 {
619 }
620
621 void HandleDummy(SpellEffIndex /*effIndex*/)
622 {
623 if (Player* caster = GetCaster()->ToPlayer())
624 caster->CastSpell(caster, caster->GetTeam() == ALLIANCE ? SPELL_LEARN_GNOMISH_BINARY : SPELL_LEARN_GOBLIN_BINARY, true);
625 }
626
631};
632
637
638// 49869 - Nauseous
658
663
664// 42254, 42255, 42256, 42257, 42258, 42259, 42260, 42261, 42263, 42264, 43959, 43961 - Weak Alcohol
684
690
691// 51694 - BOTM - Empty Bottle Throw - Resolve
720
725
726// 49466 - Mole Machine Portal Schedule
746
@ IN_MILLISECONDS
Definition Common.h:35
First const & RAND(First const &first, Second const &second, Rest const &... rest)
uint32_t uint32
Definition Define.h:133
@ TYPEID_PLAYER
Definition ObjectGuid.h:39
@ QUEST_STATUS_INCOMPLETE
Definition QuestDef.h:107
@ QUEST_STATUS_COMPLETE
Definition QuestDef.h:105
bool roll_chance_i(int chance)
Definition Random.h:59
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1128
SpellEffIndex
@ EFFECT_1
@ EFFECT_0
@ SPELL_EFFECT_DUMMY
@ SPELL_EFFECT_SCRIPT_EFFECT
@ SPELL_EFFECT_FORCE_CAST
@ ALLIANCE
@ HORDE
@ CHAT_MSG_SAY
@ AURA_REMOVE_BY_DEFAULT
AuraEffectHandleModes
@ AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK
@ AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK
@ AURA_EFFECT_HANDLE_REAL
@ SPELL_AURA_DUMMY
@ SPELL_AURA_MOUNTED
@ SPELL_AURA_MOD_DECREASE_SPEED
@ SPELL_AURA_PERIODIC_DUMMY
@ SPELL_AURA_FORCE_REACTION
@ TRIGGERED_FULL_MASK
Will return SPELL_FAILED_DONT_REPORT in CheckCast functions.
@ TRIGGERED_IGNORE_POWER_AND_REAGENT_COST
Will ignore Spell and Category cooldowns.
@ SPELLVALUE_AURA_STACK
#define SpellEffectFn(F, I, N)
#define AuraEffectPeriodicFn(F, I, N)
#define SpellCastFn(F)
#define AuraEffectApplyFn(F, I, N, M)
#define AuraEffectRemoveFn(F, I, N, M)
@ MOVE_RUN
MoleMachine
Definition brewfest.cpp:722
@ SPELL_PORT_TO_GRIM_GUZZLER
Definition brewfest.cpp:723
void AddSC_event_brewfest()
Definition brewfest.cpp:747
BartlettsBitterBrew
Definition brewfest.cpp:634
@ SPELL_BOTM_VOMIT_BREW_VOMIT_VISUAL
Definition brewfest.cpp:635
MetoksBubbleBock
Definition brewfest.cpp:500
@ SPELL_BOTM_BUBBLE_BREW_TRIGGER_MISSILE
Definition brewfest.cpp:501
EmptyBottleThrow
Definition brewfest.cpp:686
@ SPELL_BOTM_EMPTY_BOTTLE_THROW_IMPACT_CREATURE
Definition brewfest.cpp:687
@ SPELL_BOTM_EMPTY_BOTTLE_THROW_IMPACT_GROUND
Definition brewfest.cpp:688
RamBlub
Definition brewfest.cpp:276
@ SAY_THUNDERBREWS_3
Definition brewfest.cpp:306
@ SAY_THUNDERBREWS_4
Definition brewfest.cpp:307
@ SAY_BARLEYBREW_3
Definition brewfest.cpp:300
@ SAY_TCHALIS_VOODOO_2
Definition brewfest.cpp:293
@ QUEST_BARK_FOR_DROHNS_DISTILLERY
Definition brewfest.cpp:278
@ SAY_BARLEYBREW_1
Definition brewfest.cpp:298
@ SAY_TCHALIS_VOODOO_1
Definition brewfest.cpp:292
@ SAY_TCHALIS_VOODOO_4
Definition brewfest.cpp:295
@ SAY_BARLEYBREW_4
Definition brewfest.cpp:301
@ SAY_DROHN_DISTILLERY_3
Definition brewfest.cpp:288
@ QUEST_BARK_BARLEYBREW
Definition brewfest.cpp:282
@ SAY_DROHN_DISTILLERY_4
Definition brewfest.cpp:289
@ SAY_BARLEYBREW_2
Definition brewfest.cpp:299
@ SAY_DROHN_DISTILLERY_1
Definition brewfest.cpp:286
@ QUEST_BARK_FOR_THUNDERBREWS
Definition brewfest.cpp:283
@ SAY_THUNDERBREWS_1
Definition brewfest.cpp:304
@ QUEST_BARK_FOR_TCHALIS_VOODOO_BREWERY
Definition brewfest.cpp:279
@ SAY_DROHN_DISTILLERY_2
Definition brewfest.cpp:287
@ SAY_THUNDERBREWS_2
Definition brewfest.cpp:305
@ SAY_TCHALIS_VOODOO_3
Definition brewfest.cpp:294
WildWinterPilsner
Definition brewfest.cpp:448
@ SPELL_BOTM_UNLEASH_THE_BEAST
Definition brewfest.cpp:449
DraenicPaleAle
Definition brewfest.cpp:578
@ SPELL_BOTM_PINK_ELEKK
Definition brewfest.cpp:579
IzzardsEverFlavor
Definition brewfest.cpp:474
@ SPELL_BOTM_BELCH_BREW_BELCH_VISUAL
Definition brewfest.cpp:475
StranglethornBrew
Definition brewfest.cpp:552
@ SPELL_BOTM_JUNGLE_BREW_VISION_EFFECT
Definition brewfest.cpp:553
BlackrockLager
Definition brewfest.cpp:526
@ SPELL_BOTM_BELCH_FIRE_VISUAL
Definition brewfest.cpp:527
CreateEmptyBrewBottle
Definition brewfest.cpp:660
@ SPELL_BOTM_CREATE_EMPTY_BREW_BOTTLE
Definition brewfest.cpp:661
RamBlaBla
Definition brewfest.cpp:26
@ SPELL_RAM_TROT
Definition brewfest.cpp:32
@ SPELL_BREWFEST_QUEST_SPEED_BUNNY_GREEN
Definition brewfest.cpp:40
@ SPELL_SWIFT_WORK_RAM
Definition brewfest.cpp:29
@ SPELL_EXHAUSTED_RAM
Definition brewfest.cpp:36
@ SPELL_BREWFEST_QUEST_SPEED_BUNNY_YELLOW
Definition brewfest.cpp:41
@ SPELL_RENTAL_RACING_RAM
Definition brewfest.cpp:28
@ SPELL_RELAY_RACE_TURN_IN
Definition brewfest.cpp:37
@ SPELL_GIDDYUP
Definition brewfest.cpp:27
@ SPELL_RAM_CANTER
Definition brewfest.cpp:33
@ SPELL_RENTAL_RACING_RAM_AURA
Definition brewfest.cpp:30
@ SPELL_RAM_LEVEL_NEUTRAL
Definition brewfest.cpp:31
@ SPELL_RAM_FATIGUE
Definition brewfest.cpp:35
@ SPELL_BREWFEST_QUEST_SPEED_BUNNY_RED
Definition brewfest.cpp:42
@ SPELL_RAM_GALLOP
Definition brewfest.cpp:34
BrewfestMountTransformation
Definition brewfest.cpp:356
@ SPELL_BREWFEST_MOUNT_TRANSFORM_REVERSE
Definition brewfest.cpp:362
@ SPELL_MOUNT_RAM_60
Definition brewfest.cpp:358
@ SPELL_BREWFEST_MOUNT_TRANSFORM
Definition brewfest.cpp:361
@ SPELL_MOUNT_RAM_100
Definition brewfest.cpp:357
@ SPELL_MOUNT_KODO_100
Definition brewfest.cpp:359
@ SPELL_MOUNT_KODO_60
Definition brewfest.cpp:360
BinaryBrew
Definition brewfest.cpp:606
@ SPELL_LEARN_GOBLIN_BINARY
Definition brewfest.cpp:608
@ SPELL_LEARN_GNOMISH_BINARY
Definition brewfest.cpp:607
uint32 GetTickNumber() const
AuraApplication const * GetTargetApplication() const
HookList< EffectApplyHandler > AfterEffectRemove
HookList< EffectPeriodicHandler > OnEffectPeriodic
HookList< EffectApplyHandler > AfterEffectApply
Unit * GetTarget() const
HookList< EffectApplyHandler > OnEffectRemove
Unit * GetUnitOwner() const
uint8 GetStackAmount() const
HookList< EffectApplyHandler > OnEffectApply
uint32 GetId() const
TypeID GetTypeId() const
Definition Object.h:93
static Player * ToPlayer(Object *o)
Definition Object.h:180
uint32 GetTeam() const
Definition Player.h:1832
QuestStatus GetQuestStatus(uint32 quest_id) const
Definition Player.cpp:15642
HookList< CastHandler > AfterCast
WorldLocation * GetHitDest() const
Unit * GetCaster() const
HookList< EffectHandler > OnEffectHit
void PreventHitDefaultEffect(SpellEffIndex effIndex)
Unit * GetHitUnit() const
SpellEffectInfo const & GetEffectInfo() const
HookList< EffectHandler > OnEffectHitTarget
SpellInfo const * GetSpellInfo() const
Definition Unit.h:769
void RemoveAurasByType(AuraType auraType, std::function< bool(AuraApplication const *)> const &check, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3765
Aura * GetAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition Unit.cpp:4439
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3638
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition Unit.cpp:4535
void RemoveAuraFromStack(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3800
bool HasAuraType(AuraType auraType) const
Definition Unit.cpp:4542
float GetSpeedRate(UnitMoveType mtype) const
Definition Unit.h:1654
virtual void Talk(std::string_view text, ChatMsg msgType, Language language, float textRange, WorldObject const *target)
Definition Unit.cpp:13826
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2832
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
PrepareAuraScript(spell_brewfest_apple_trap)
void Register() override
Definition brewfest.cpp:195
void OnApply(AuraEffect const *, AuraEffectHandleModes)
Definition brewfest.cpp:190
void OnApply(AuraEffect const *, AuraEffectHandleModes)
Definition brewfest.cpp:323
PrepareAuraScript(spell_brewfest_barker_bunny)
bool Validate(SpellInfo const *) override
Definition brewfest.cpp:509
PrepareAuraScript(spell_brewfest_botm_bloated)
void AfterRemove(AuraEffect const *, AuraEffectHandleModes)
Definition brewfest.cpp:514
bool Validate(SpellInfo const *) override
Definition brewfest.cpp:696
PrepareSpellScript(spell_brewfest_botm_empty_bottle_throw_resolve)
bool Validate(SpellInfo const *) override
Definition brewfest.cpp:483
void AfterRemove(AuraEffect const *, AuraEffectHandleModes)
Definition brewfest.cpp:488
void Register() override
Definition brewfest.cpp:493
PrepareAuraScript(spell_brewfest_botm_gassy)
bool Validate(SpellInfo const *) override
Definition brewfest.cpp:535
void AfterRemove(AuraEffect const *, AuraEffectHandleModes)
Definition brewfest.cpp:540
PrepareAuraScript(spell_brewfest_botm_internal_combustion)
PrepareSpellScript(spell_brewfest_botm_jungle_madness)
bool Validate(SpellInfo const *) override
Definition brewfest.cpp:561
bool Validate(SpellInfo const *) override
Definition brewfest.cpp:643
void AfterRemove(AuraEffect const *, AuraEffectHandleModes)
Definition brewfest.cpp:648
PrepareAuraScript(spell_brewfest_botm_nauseous)
bool Validate(SpellInfo const *) override
Definition brewfest.cpp:587
PrepareSpellScript(spell_brewfest_botm_pink_elekk)
PrepareSpellScript(spell_brewfest_botm_teach_language)
bool Validate(SpellInfo const *) override
Definition brewfest.cpp:616
void HandleDummy(SpellEffIndex)
Definition brewfest.cpp:621
void AfterRemove(AuraEffect const *, AuraEffectHandleModes)
Definition brewfest.cpp:462
bool Validate(SpellInfo const *) override
Definition brewfest.cpp:457
PrepareAuraScript(spell_brewfest_botm_the_beast_within)
PrepareSpellScript(spell_brewfest_botm_weak_alcohol)
bool Validate(SpellInfo const *) override
Definition brewfest.cpp:669
PrepareSpellScript(spell_brewfest_dismount_ram)
void HandleScript(SpellEffIndex)
Definition brewfest.cpp:264
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
Definition brewfest.cpp:206
PrepareAuraScript(spell_brewfest_exhausted_ram)
void OnPeriodic(AuraEffect const *)
Definition brewfest.cpp:89
PrepareAuraScript(spell_brewfest_giddyup)
void OnChange(AuraEffect const *, AuraEffectHandleModes)
Definition brewfest.cpp:50
void Register() override
Definition brewfest.cpp:94
PrepareSpellScript(spell_brewfest_mole_machine_portal_schedule)
bool Validate(SpellInfo const *) override
Definition brewfest.cpp:731
bool Validate(SpellInfo const *) override
Definition brewfest.cpp:371
PrepareSpellScript(spell_brewfest_mount_transformation)
PrepareAuraScript(spell_brewfest_ram_fatigue)
void Register() override
Definition brewfest.cpp:179
void OnApply(AuraEffect const *, AuraEffectHandleModes)
Definition brewfest.cpp:163
void OnPeriodic(AuraEffect const *aurEff)
Definition brewfest.cpp:110
PrepareAuraScript(spell_brewfest_ram)
void Register() override
Definition brewfest.cpp:152
PrepareSpellScript(spell_brewfest_relay_race_intro_force_player_to_throw)
void HandleDummy(SpellEffIndex effIndex)
Definition brewfest.cpp:242
PrepareSpellScript(spell_brewfest_relay_race_turn_in)
#define sWorld
Definition World.h:900
@ CONFIG_LISTEN_RANGE_SAY
Definition World.h:189
CastSpellExtraArgs & AddSpellMod(SpellValueMod mod, int32 val)