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
440 {
442 if (!player)
443 return;
444
445 uint32 spellId = 0;
446 switch (GetSpellInfo()->Id)
447 {
449 spellId = SPELL_PLAYER_TURKEY;
450 break;
452 spellId = SPELL_PLAYER_STUFFING;
453 break;
455 spellId = SPELL_PLAYER_PIE;
456 break;
458 spellId = SPELL_PLAYER_CRANBERRY;
459 break;
462 break;
463 }
464
465 if (spellId)
466 {
467 player->CastSpell(player, spellId, true);
468 if (AuraEffect* aur = player->GetAuraEffectDummy(spellId))
469 {
470 if (aur->GetBase()->GetStackAmount() >= 5)
471 {
472 switch (spellId)
473 {
475 player->CastSpell(player, SPELL_WELL_FED_TURKEY, true);
476 break;
478 player->CastSpell(player, SPELL_WELL_FED_STUFFING, true);
479 break;
480 case SPELL_PLAYER_PIE:
481 player->CastSpell(player, SPELL_WELL_FED_PIE, true);
482 break;
484 player->CastSpell(player, SPELL_WELL_FED_CRANBERRY, true);
485 break;
487 player->CastSpell(player, SPELL_WELL_FED_SWEET_POTATOES, true);
488 break;
489 }
490
491 uint8 count = 0;
493 for (Unit::AuraEffectList::const_iterator i = dummyAuras.begin(); i != dummyAuras.end(); ++i)
494 {
495 if ((*i)->GetId() >= SPELL_PLAYER_CRANBERRY && (*i)->GetId() <= SPELL_PLAYER_PIE)
496 if ((*i)->GetBase()->GetStackAmount() >= 5)
497 ++count;
498 }
499
500 // Cast spirit of sharing
501 if (count >= 5)
502 player->CastSpell(player, SPELL_SPIRIT_OF_SHARING, true);
503 }
504 }
505 }
506 }
std::uint8_t uint8
Definition: Define.h:110
std::uint32_t uint32
Definition: Define.h:108
@ SPELL_AURA_DUMMY
Definition: SpellAuraDefines.h:67
@ SPELL_FEAST_ON_PIE
Definition: pilgrims_bounty.cpp:72
@ SPELL_PLAYER_TURKEY
Definition: pilgrims_bounty.cpp:76
@ SPELL_WELL_FED_TURKEY
Definition: pilgrims_bounty.cpp:82
@ SPELL_WELL_FED_SWEET_POTATOES
Definition: pilgrims_bounty.cpp:86
@ SPELL_PLAYER_SWEET_POTATOES
Definition: pilgrims_bounty.cpp:80
@ SPELL_WELL_FED_STUFFING
Definition: pilgrims_bounty.cpp:83
@ SPELL_FEAST_ON_TURKEY
Definition: pilgrims_bounty.cpp:70
@ SPELL_PLAYER_CRANBERRY
Definition: pilgrims_bounty.cpp:79
@ SPELL_FEAST_ON_STUFFING
Definition: pilgrims_bounty.cpp:71
@ SPELL_PLAYER_STUFFING
Definition: pilgrims_bounty.cpp:77
@ SPELL_SPIRIT_OF_SHARING
Definition: pilgrims_bounty.cpp:94
@ SPELL_PLAYER_PIE
Definition: pilgrims_bounty.cpp:78
@ SPELL_FEAST_ON_SWEET_POTATOES
Definition: pilgrims_bounty.cpp:74
@ SPELL_WELL_FED_PIE
Definition: pilgrims_bounty.cpp:84
@ SPELL_WELL_FED_CRANBERRY
Definition: pilgrims_bounty.cpp:85
@ SPELL_FEAST_ON_CRANBERRY
Definition: pilgrims_bounty.cpp:73
Definition: Player.h:1046
AuraEffectList const & GetAuraEffectsByType(AuraType type) const
Definition: Unit.h:1967
Player * GetCharmerOrOwnerPlayerOrPlayerItself() const
Definition: Unit.cpp:10576
AuraEffect * GetAuraEffectDummy(uint32 spellid) const
Definition: Unit.cpp:5468
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:1169
std::list< AuraEffect * > AuraEffectList
Definition: Unit.h:1306
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.

509 {
511 }
#define SpellEffectFn(F, I, N)
Definition: SpellScript.h:337
@ EFFECT_0
Definition: SharedDefines.h:30
@ SPELL_EFFECT_DUMMY
Definition: SharedDefines.h:753
HookList< EffectHandler > OnEffectHitTarget
Definition: SpellScript.h:336
void HandleDummy(SpellEffIndex)
Definition: pilgrims_bounty.cpp:439

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