AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
spell_pilgrims_bounty_feast_on_generic Class Reference
Inheritance diagram for spell_pilgrims_bounty_feast_on_generic:
SpellScript _SpellScript

Private Member Functions

 PrepareSpellScript (spell_pilgrims_bounty_feast_on_generic)
 
void HandleDummy (SpellEffIndex)
 
void Register () override
 

Additional Inherited Members

- Public Member Functions inherited from SpellScript
bool _Validate (SpellInfo const *entry) override
 
bool _Load (Spell *spell)
 
void _InitHit ()
 
bool _IsEffectPrevented (SpellEffIndex effIndex)
 
bool _IsDefaultEffectPrevented (SpellEffIndex effIndex)
 
void _PrepareScriptCall (SpellScriptHookType hookType)
 
void _FinishScriptCall ()
 
bool IsInCheckCastHook () const
 
bool IsInTargetHook () const
 
bool IsInHitPhase () const
 
bool IsInEffectHook () const
 
UnitGetCaster ()
 
UnitGetOriginalCaster ()
 
SpellInfo const * GetSpellInfo ()
 
SpellValue const * GetSpellValue ()
 
WorldLocation const * GetExplTargetDest ()
 
void SetExplTargetDest (WorldLocation &loc)
 
WorldObjectGetExplTargetWorldObject ()
 
UnitGetExplTargetUnit ()
 
GameObjectGetExplTargetGObj ()
 
ItemGetExplTargetItem ()
 
UnitGetHitUnit ()
 
CreatureGetHitCreature ()
 
PlayerGetHitPlayer ()
 
ItemGetHitItem ()
 
GameObjectGetHitGObj ()
 
WorldLocationGetHitDest ()
 
int32 GetHitDamage ()
 
void SetHitDamage (int32 damage)
 
void PreventHitDamage ()
 
int32 GetHitHeal ()
 
void SetHitHeal (int32 heal)
 
void PreventHitHeal ()
 
SpellGetSpell ()
 
AuraGetHitAura ()
 
void PreventHitAura ()
 
void PreventHitEffect (SpellEffIndex effIndex)
 
void PreventHitDefaultEffect (SpellEffIndex effIndex)
 
int32 GetEffectValue () const
 
void SetEffectValue (int32 value)
 
ItemGetCastItem ()
 
void CreateItem (uint32 effIndex, uint32 itemId)
 
SpellInfo const * GetTriggeringSpell ()
 
void FinishCast (SpellCastResult result)
 
void Cancel ()
 
void SetCustomCastResultMessage (SpellCustomErrors result)
 
- Public Member Functions inherited from _SpellScript
 _SpellScript ()
 
virtual ~_SpellScript ()
 
virtual void _Register ()
 
virtual void _Unload ()
 
virtual void _Init (std::string const *scriptname, uint32 spellId)
 
std::string const * _GetScriptName () const
 
virtual void Register ()=0
 
virtual bool Validate (SpellInfo const *)
 
virtual bool Load ()
 
virtual void Unload ()
 
- Static Public Member Functions inherited from _SpellScript
static bool ValidateSpellInfo (std::initializer_list< uint32 > spellIds)
 
template<class T >
static bool ValidateSpellInfo (T const &spellIds)
 
- Public Attributes inherited from SpellScript
HookList< CastHandlerBeforeCast
 
HookList< CastHandlerOnCast
 
HookList< CastHandlerAfterCast
 
HookList< CheckCastHandlerOnCheckCast
 
HookList< EffectHandlerOnEffectLaunch
 
HookList< EffectHandlerOnEffectLaunchTarget
 
HookList< EffectHandlerOnEffectHit
 
HookList< EffectHandlerOnEffectHitTarget
 
HookList< BeforeHitHandlerBeforeHit
 
HookList< HitHandlerOnHit
 
HookList< HitHandlerAfterHit
 
HookList< ObjectAreaTargetSelectHandlerOnObjectAreaTargetSelect
 
HookList< ObjectTargetSelectHandlerOnObjectTargetSelect
 
HookList< DestinationTargetSelectHandlerOnDestinationTargetSelect
 
virtual bool _Validate (SpellInfo const *entry)
 
- Protected Attributes inherited from _SpellScript
uint8 m_currentScriptState
 
std::string const * m_scriptName
 
uint32 m_scriptSpellId
 

Detailed Description

Member Function Documentation

◆ HandleDummy()

void spell_pilgrims_bounty_feast_on_generic::HandleDummy ( SpellEffIndex  )
inlineprivate
441 {
443 if (!player)
444 return;
445
446 uint32 spellId = 0;
447 switch (GetSpellInfo()->Id)
448 {
450 spellId = SPELL_PLAYER_TURKEY;
451 break;
453 spellId = SPELL_PLAYER_STUFFING;
454 break;
456 spellId = SPELL_PLAYER_PIE;
457 break;
459 spellId = SPELL_PLAYER_CRANBERRY;
460 break;
463 break;
464 }
465
466 if (spellId)
467 {
468 player->CastSpell(player, spellId, true);
469 if (AuraEffect* aur = player->GetAuraEffectDummy(spellId))
470 {
471 if (aur->GetBase()->GetStackAmount() >= 5)
472 {
473 switch (spellId)
474 {
476 player->CastSpell(player, SPELL_WELL_FED_TURKEY, true);
477 break;
479 player->CastSpell(player, SPELL_WELL_FED_STUFFING, true);
480 break;
481 case SPELL_PLAYER_PIE:
482 player->CastSpell(player, SPELL_WELL_FED_PIE, true);
483 break;
485 player->CastSpell(player, SPELL_WELL_FED_CRANBERRY, true);
486 break;
488 player->CastSpell(player, SPELL_WELL_FED_SWEET_POTATOES, true);
489 break;
490 }
491
492 uint8 count = 0;
494 for (Unit::AuraEffectList::const_iterator i = dummyAuras.begin(); i != dummyAuras.end(); ++i)
495 {
496 if ((*i)->GetId() >= SPELL_PLAYER_CRANBERRY && (*i)->GetId() <= SPELL_PLAYER_PIE)
497 if ((*i)->GetBase()->GetStackAmount() >= 5)
498 ++count;
499 }
500
501 // Cast spirit of sharing
502 if (count >= 5)
503 player->CastSpell(player, SPELL_SPIRIT_OF_SHARING, true);
504 }
505 }
506 }
507 }
std::uint8_t uint8
Definition: Define.h:109
std::uint32_t uint32
Definition: Define.h:107
@ SPELL_AURA_DUMMY
Definition: SpellAuraDefines.h:67
@ SPELL_FEAST_ON_PIE
Definition: pilgrims_bounty.cpp:73
@ SPELL_PLAYER_TURKEY
Definition: pilgrims_bounty.cpp:77
@ SPELL_WELL_FED_TURKEY
Definition: pilgrims_bounty.cpp:83
@ SPELL_WELL_FED_SWEET_POTATOES
Definition: pilgrims_bounty.cpp:87
@ SPELL_PLAYER_SWEET_POTATOES
Definition: pilgrims_bounty.cpp:81
@ SPELL_WELL_FED_STUFFING
Definition: pilgrims_bounty.cpp:84
@ SPELL_FEAST_ON_TURKEY
Definition: pilgrims_bounty.cpp:71
@ SPELL_PLAYER_CRANBERRY
Definition: pilgrims_bounty.cpp:80
@ SPELL_FEAST_ON_STUFFING
Definition: pilgrims_bounty.cpp:72
@ SPELL_PLAYER_STUFFING
Definition: pilgrims_bounty.cpp:78
@ SPELL_SPIRIT_OF_SHARING
Definition: pilgrims_bounty.cpp:95
@ SPELL_PLAYER_PIE
Definition: pilgrims_bounty.cpp:79
@ SPELL_FEAST_ON_SWEET_POTATOES
Definition: pilgrims_bounty.cpp:75
@ SPELL_WELL_FED_PIE
Definition: pilgrims_bounty.cpp:85
@ SPELL_WELL_FED_CRANBERRY
Definition: pilgrims_bounty.cpp:86
@ SPELL_FEAST_ON_CRANBERRY
Definition: pilgrims_bounty.cpp:74
Definition: Player.h:1064
AuraEffectList const & GetAuraEffectsByType(AuraType type) const
Definition: Unit.h:1362
Player * GetCharmerOrOwnerPlayerOrPlayerItself() const
Definition: Unit.cpp:10578
AuraEffect * GetAuraEffectDummy(uint32 spellid) const
Definition: Unit.cpp:5521
SpellCastResult CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:1168
std::list< AuraEffect * > AuraEffectList
Definition: Unit.h:646
Definition: SpellAuraEffects.h:39
SpellInfo const * GetSpellInfo()
Definition: SpellScript.cpp:411
Unit * GetCaster()
Definition: SpellScript.cpp:401

References Unit::CastSpell(), Unit::GetAuraEffectDummy(), Unit::GetAuraEffectsByType(), SpellScript::GetCaster(), Unit::GetCharmerOrOwnerPlayerOrPlayerItself(), SpellScript::GetSpellInfo(), SPELL_AURA_DUMMY, SPELL_FEAST_ON_CRANBERRY, SPELL_FEAST_ON_PIE, SPELL_FEAST_ON_STUFFING, SPELL_FEAST_ON_SWEET_POTATOES, SPELL_FEAST_ON_TURKEY, SPELL_PLAYER_CRANBERRY, SPELL_PLAYER_PIE, SPELL_PLAYER_STUFFING, SPELL_PLAYER_SWEET_POTATOES, SPELL_PLAYER_TURKEY, SPELL_SPIRIT_OF_SHARING, SPELL_WELL_FED_CRANBERRY, SPELL_WELL_FED_PIE, SPELL_WELL_FED_STUFFING, SPELL_WELL_FED_SWEET_POTATOES, and SPELL_WELL_FED_TURKEY.

Referenced by Register().

◆ PrepareSpellScript()

spell_pilgrims_bounty_feast_on_generic::PrepareSpellScript ( spell_pilgrims_bounty_feast_on_generic  )
private

◆ Register()

void spell_pilgrims_bounty_feast_on_generic::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

510 {
512 }
#define SpellEffectFn(F, I, N)
Definition: SpellScript.h:337
@ EFFECT_0
Definition: SharedDefines.h:31
@ SPELL_EFFECT_DUMMY
Definition: SharedDefines.h:781
HookList< EffectHandler > OnEffectHitTarget
Definition: SpellScript.h:336
void HandleDummy(SpellEffIndex)
Definition: pilgrims_bounty.cpp:440

References EFFECT_0, HandleDummy(), SpellScript::OnEffectHitTarget, SPELL_EFFECT_DUMMY, and SpellEffectFn.