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{
48 void OnChange(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
49 {
50 Unit* target = GetTarget();
52 {
53 target->RemoveAura(GetId());
54 return;
55 }
56
57 if (target->HasAura(SPELL_EXHAUSTED_RAM))
58 return;
59
60 switch (GetStackAmount())
61 {
62 case 1: // green
65 target->CastSpell(target, SPELL_RAM_TROT, true);
66 break;
67 case 6: // yellow
70 target->CastSpell(target, SPELL_RAM_CANTER, true);
71 break;
72 case 11: // red
74 target->CastSpell(target, SPELL_RAM_GALLOP, true);
75 break;
76 default:
77 break;
78 }
79
80 if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_DEFAULT)
81 {
83 target->CastSpell(target, SPELL_RAM_LEVEL_NEUTRAL, true);
84 }
85 }
86
87 void OnPeriodic(AuraEffect const* /*aurEff*/)
88 {
90 }
91
98};
99
100// 43310 - Ram Level - Neutral
101// 42992 - Ram - Trot
102// 42993 - Ram - Canter
103// 42994 - Ram - Gallop
105{
106 void OnPeriodic(AuraEffect const* aurEff)
107 {
108 Unit* target = GetTarget();
109 if (target->HasAura(SPELL_EXHAUSTED_RAM))
110 return;
111
112 switch (GetId())
113 {
115 if (Aura* aura = target->GetAura(SPELL_RAM_FATIGUE))
116 aura->ModStackAmount(-4);
117 break;
118 case SPELL_RAM_TROT: // green
119 if (Aura* aura = target->GetAura(SPELL_RAM_FATIGUE))
120 aura->ModStackAmount(-2);
121 if (aurEff->GetTickNumber() == 4)
123 break;
124 case SPELL_RAM_CANTER:
125 {
128 target->CastSpell(target, SPELL_RAM_FATIGUE, args);
129 if (aurEff->GetTickNumber() == 8)
131 break;
132 }
133 case SPELL_RAM_GALLOP:
134 {
136 args.AddSpellMod(SPELLVALUE_AURA_STACK, target->HasAura(SPELL_RAM_FATIGUE) ? 4 : 5 /*Hack*/);
137 target->CastSpell(target, SPELL_RAM_FATIGUE, args);
138 if (aurEff->GetTickNumber() == 8)
139 target->CastSpell(target, SPELL_BREWFEST_QUEST_SPEED_BUNNY_RED, true);
140 break;
141 }
142 default:
143 break;
144 }
145
146 }
147
152};
153
154// 43052 - Ram Fatigue
156{
157 void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
158 {
159 Unit* target = GetTarget();
160
161 if (GetStackAmount() == 101)
162 {
164 target->RemoveAura(SPELL_RAM_TROT);
167 target->RemoveAura(SPELL_GIDDYUP);
168
169 target->CastSpell(target, SPELL_EXHAUSTED_RAM, true);
170 }
171 }
172
177};
178
179// 43450 - Brewfest - apple trap - friendly DND
192
193// 43332 - Exhausted Ram
207
208// 43755 - Brewfest - Daily - Relay Race - Player - Increase Mount Duration - DND
210{
212 {
213 PreventHitDefaultEffect(effIndex);
214
215 if (Aura* aura = GetHitUnit()->GetAura(SPELL_SWIFT_WORK_RAM))
216 {
217 aura->SetDuration(aura->GetDuration() + 30 * IN_MILLISECONDS);
219 }
220 }
221
226};
227
228// 43876 - Dismount Ram
241
243{
244 // Horde
247
248 // Alliance
251
252 // Bark for Drohn's Distillery!
257
258 // Bark for T'chali's Voodoo Brewery!
263
264 // Bark for the Barleybrews!
269
270 // Bark for the Thunderbrews!
274 SAY_THUNDERBREWS_4 = 22942
276
277// 43259 Brewfest - Barker Bunny 1
278// 43260 Brewfest - Barker Bunny 2
279// 43261 Brewfest - Barker Bunny 3
280// 43262 Brewfest - Barker Bunny 4
282{
283 bool Load() override
284 {
285 return GetUnitOwner()->GetTypeId() == TYPEID_PLAYER;
286 }
287
313
318};
319
329
330// 49357 - Brewfest Mount Transformation
331// 52845 - Brewfest Mount Transformation (Faction Swap)
333{
334 bool Validate(SpellInfo const* /*spell*/) override
335 {
336 return ValidateSpellInfo(
337 {
342 });
343 }
344
345 void HandleDummy(SpellEffIndex /* effIndex */)
346 {
347 Player* caster = GetCaster()->ToPlayer();
348 if (caster->HasAuraType(SPELL_AURA_MOUNTED))
349 {
351 uint32 spell_id;
352
353 switch (GetSpellInfo()->Id)
354 {
356 if (caster->GetSpeedRate(MOVE_RUN) >= 2.0f)
357 spell_id = caster->GetTeam() == ALLIANCE ? SPELL_MOUNT_RAM_100 : SPELL_MOUNT_KODO_100;
358 else
359 spell_id = caster->GetTeam() == ALLIANCE ? SPELL_MOUNT_RAM_60 : SPELL_MOUNT_KODO_60;
360 break;
362 if (caster->GetSpeedRate(MOVE_RUN) >= 2.0f)
363 spell_id = caster->GetTeam() == HORDE ? SPELL_MOUNT_RAM_100 : SPELL_MOUNT_KODO_100;
364 else
365 spell_id = caster->GetTeam() == HORDE ? SPELL_MOUNT_RAM_60 : SPELL_MOUNT_KODO_60;
366 break;
367 default:
368 return;
369 }
370 caster->CastSpell(caster, spell_id, true);
371 }
372 }
373
378};
379
380/*
381 Brew of the Month
382 January [Wild Winter Pilsner]
383 spell_brewfest_botm_the_beast_within
384 February [Izzard's Ever Flavor]
385 spell_brewfest_botm_gassy
386 March [Aromatic Honey Brew]
387 Nothing to script here
388 April [Metok's Bubble Bock]
389 spell_brewfest_botm_bloated
390 Incomplete (spells 49828, 49827, 49830, 49837)
391 May [Springtime Stout]
392 Nothing to script here
393 June [Blackrock Lager]
394 spell_brewfest_botm_internal_combustion
395 July [Stranglethorn Brew]
396 spell_brewfest_botm_jungle_madness
397 August [Draenic Pale Ale]
398 NYI
399 September [Binary Brew]
400 spell_brewfest_botm_teach_language
401 October [Autumnal Acorn Ale]
402 NYI
403 November [Bartlett's Bitter Brew]
404 NYI
405 December [Lord of Frost's Private Label]
406 Nothing to script here
407*/
408
413
414// 50098 - The Beast Within
432
437
438// 49864 - Gassy
456
461
462// 49822 - Bloated
480
485
486// 49738 - Internal Combustion
504
509
510// 49962 - Jungle Madness!
528
534
535// 50243 - Teach Language
537{
538 bool Validate(SpellInfo const* /*spellInfo*/) override
539 {
541 }
542
543 void HandleDummy(SpellEffIndex /*effIndex*/)
544 {
545 if (Player* caster = GetCaster()->ToPlayer())
546 caster->CastSpell(caster, caster->GetTeam() == ALLIANCE ? SPELL_LEARN_GNOMISH_BINARY : SPELL_LEARN_GOBLIN_BINARY, true);
547 }
548
553};
554
559
560// 42254, 42255, 42256, 42257, 42258, 42259, 42260, 42261, 42263, 42264, 43959, 43961 - Weak Alcohol
562{
563 bool Validate(SpellInfo const* /*spellInfo*/) override
564 {
566 }
567
572
577};
578
584
585// 51694 - BOTM - Empty Bottle Throw - Resolve
587{
588 bool Validate(SpellInfo const* /*spellInfo*/) override
589 {
590 return ValidateSpellInfo(
591 {
594 });
595 }
596
597 void HandleDummy(SpellEffIndex /*effIndex*/)
598 {
599 Unit* caster = GetCaster();
600
601 if (Unit* target = GetHitUnit())
603 else
605 }
606
611};
612
@ IN_MILLISECONDS
Definition Common.h:38
First const & RAND(First const &first, Second const &second, Rest const &... rest)
uint32_t uint32
Definition Define.h:154
@ TYPEID_PLAYER
Definition ObjectGuid.h:44
@ QUEST_STATUS_INCOMPLETE
Definition QuestDef.h:150
@ QUEST_STATUS_COMPLETE
Definition QuestDef.h:148
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1383
SpellEffIndex
@ EFFECT_1
@ EFFECT_0
@ SPELL_EFFECT_DUMMY
@ SPELL_EFFECT_SCRIPT_EFFECT
@ ALLIANCE
@ HORDE
@ CHAT_MSG_SAY
AuraEffectHandleModes
@ AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK
@ AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK
@ AURA_EFFECT_HANDLE_REAL
@ AURA_REMOVE_BY_DEFAULT
@ SPELL_AURA_DUMMY
@ SPELL_AURA_MOUNTED
@ SPELL_AURA_MOD_DECREASE_SPEED
@ SPELL_AURA_PERIODIC_DUMMY
@ SPELL_AURA_FORCE_REACTION
@ SPELLVALUE_AURA_STACK
@ TRIGGERED_FULL_MASK
Used when doing CastSpell with triggered == true.
#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
void AddSC_event_brewfest()
Definition brewfest.cpp:613
MetoksBubbleBock
Definition brewfest.cpp:458
@ SPELL_BOTM_BUBBLE_BREW_TRIGGER_MISSILE
Definition brewfest.cpp:459
EmptyBottleThrow
Definition brewfest.cpp:580
@ SPELL_BOTM_EMPTY_BOTTLE_THROW_IMPACT_CREATURE
Definition brewfest.cpp:581
@ SPELL_BOTM_EMPTY_BOTTLE_THROW_IMPACT_GROUND
Definition brewfest.cpp:582
RamBlub
Definition brewfest.cpp:243
@ SAY_THUNDERBREWS_3
Definition brewfest.cpp:273
@ SAY_THUNDERBREWS_4
Definition brewfest.cpp:274
@ SAY_BARLEYBREW_3
Definition brewfest.cpp:267
@ SAY_TCHALIS_VOODOO_2
Definition brewfest.cpp:260
@ QUEST_BARK_FOR_DROHNS_DISTILLERY
Definition brewfest.cpp:245
@ SAY_BARLEYBREW_1
Definition brewfest.cpp:265
@ SAY_TCHALIS_VOODOO_1
Definition brewfest.cpp:259
@ SAY_TCHALIS_VOODOO_4
Definition brewfest.cpp:262
@ SAY_BARLEYBREW_4
Definition brewfest.cpp:268
@ SAY_DROHN_DISTILLERY_3
Definition brewfest.cpp:255
@ QUEST_BARK_BARLEYBREW
Definition brewfest.cpp:249
@ SAY_DROHN_DISTILLERY_4
Definition brewfest.cpp:256
@ SAY_BARLEYBREW_2
Definition brewfest.cpp:266
@ SAY_DROHN_DISTILLERY_1
Definition brewfest.cpp:253
@ QUEST_BARK_FOR_THUNDERBREWS
Definition brewfest.cpp:250
@ SAY_THUNDERBREWS_1
Definition brewfest.cpp:271
@ QUEST_BARK_FOR_TCHALIS_VOODOO_BREWERY
Definition brewfest.cpp:246
@ SAY_DROHN_DISTILLERY_2
Definition brewfest.cpp:254
@ SAY_THUNDERBREWS_2
Definition brewfest.cpp:272
@ SAY_TCHALIS_VOODOO_3
Definition brewfest.cpp:261
WildWinterPilsner
Definition brewfest.cpp:410
@ SPELL_BOTM_UNLEASH_THE_BEAST
Definition brewfest.cpp:411
IzzardsEverFlavor
Definition brewfest.cpp:434
@ SPELL_BOTM_BELCH_BREW_BELCH_VISUAL
Definition brewfest.cpp:435
StranglethornBrew
Definition brewfest.cpp:506
@ SPELL_BOTM_JUNGLE_BREW_VISION_EFFECT
Definition brewfest.cpp:507
BlackrockLager
Definition brewfest.cpp:482
@ SPELL_BOTM_BELCH_FIRE_VISUAL
Definition brewfest.cpp:483
CreateEmptyBrewBottle
Definition brewfest.cpp:556
@ SPELL_BOTM_CREATE_EMPTY_BREW_BOTTLE
Definition brewfest.cpp:557
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:321
@ SPELL_BREWFEST_MOUNT_TRANSFORM_REVERSE
Definition brewfest.cpp:327
@ SPELL_MOUNT_RAM_60
Definition brewfest.cpp:323
@ SPELL_BREWFEST_MOUNT_TRANSFORM
Definition brewfest.cpp:326
@ SPELL_MOUNT_RAM_100
Definition brewfest.cpp:322
@ SPELL_MOUNT_KODO_100
Definition brewfest.cpp:324
@ SPELL_MOUNT_KODO_60
Definition brewfest.cpp:325
BinaryBrew
Definition brewfest.cpp:530
@ SPELL_LEARN_GOBLIN_BINARY
Definition brewfest.cpp:532
@ SPELL_LEARN_GNOMISH_BINARY
Definition brewfest.cpp:531
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 BaseEntity.h:166
Player * ToPlayer()
Definition Object.h:126
QuestStatus GetQuestStatus(uint32 quest_id) const
Definition Player.cpp:15962
Team GetTeam() const
Definition Player.h:2423
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
HookList< CastHandler > AfterCast
WorldLocation * GetHitDest() const
Unit * GetCaster() const
HookList< EffectHandler > OnEffectHit
void PreventHitDefaultEffect(SpellEffIndex effIndex)
Unit * GetHitUnit() const
HookList< EffectHandler > OnEffectHitTarget
SpellInfo const * GetSpellInfo() const
Definition Unit.h:635
void RemoveAurasByType(AuraType auraType, std::function< bool(AuraApplication const *)> const &check, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3955
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3828
Aura * GetAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition Unit.cpp:4700
bool HasAuraType(AuraType auraType) const
Definition Unit.cpp:4814
void RemoveAuraFromStack(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT, uint16 num=1)
Definition Unit.cpp:3990
float GetSpeedRate(UnitMoveType mtype) const
Definition Unit.h:1707
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition Unit.cpp:4804
virtual void Talk(std::string_view text, ChatMsg msgType, Language language, float textRange, WorldObject const *target)
Definition Unit.cpp:14324
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2217
void Register() override
Definition brewfest.cpp:187
void OnApply(AuraEffect const *, AuraEffectHandleModes)
Definition brewfest.cpp:182
void OnApply(AuraEffect const *, AuraEffectHandleModes)
Definition brewfest.cpp:288
bool Validate(SpellInfo const *) override
Definition brewfest.cpp:465
void AfterRemove(AuraEffect const *, AuraEffectHandleModes)
Definition brewfest.cpp:470
bool Validate(SpellInfo const *) override
Definition brewfest.cpp:588
bool Validate(SpellInfo const *) override
Definition brewfest.cpp:441
void AfterRemove(AuraEffect const *, AuraEffectHandleModes)
Definition brewfest.cpp:446
void Register() override
Definition brewfest.cpp:451
bool Validate(SpellInfo const *) override
Definition brewfest.cpp:489
void AfterRemove(AuraEffect const *, AuraEffectHandleModes)
Definition brewfest.cpp:494
bool Validate(SpellInfo const *) override
Definition brewfest.cpp:513
bool Validate(SpellInfo const *) override
Definition brewfest.cpp:538
void HandleDummy(SpellEffIndex)
Definition brewfest.cpp:543
void AfterRemove(AuraEffect const *, AuraEffectHandleModes)
Definition brewfest.cpp:422
bool Validate(SpellInfo const *) override
Definition brewfest.cpp:417
bool Validate(SpellInfo const *) override
Definition brewfest.cpp:563
void HandleScript(SpellEffIndex)
Definition brewfest.cpp:231
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
Definition brewfest.cpp:196
void OnPeriodic(AuraEffect const *)
Definition brewfest.cpp:87
void OnChange(AuraEffect const *, AuraEffectHandleModes)
Definition brewfest.cpp:48
void Register() override
Definition brewfest.cpp:92
bool Validate(SpellInfo const *) override
Definition brewfest.cpp:334
void Register() override
Definition brewfest.cpp:173
void OnApply(AuraEffect const *, AuraEffectHandleModes)
Definition brewfest.cpp:157
void OnPeriodic(AuraEffect const *aurEff)
Definition brewfest.cpp:106
void Register() override
Definition brewfest.cpp:148
void HandleDummy(SpellEffIndex effIndex)
Definition brewfest.cpp:211
#define sWorld
Definition World.h:916
@ CONFIG_LISTEN_RANGE_SAY
Definition World.h:209
CastSpellExtraArgs & AddSpellMod(SpellValueMod mod, int32 val)