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
 
Unit * GetCaster ()
 
GameObject * GetGObjCaster ()
 
Unit * GetOriginalCaster ()
 
SpellInfo const * GetSpellInfo ()
 
SpellValue const * GetSpellValue ()
 
WorldLocation const * GetExplTargetDest ()
 
void SetExplTargetDest (WorldLocation &loc)
 
WorldObject * GetExplTargetWorldObject ()
 
Unit * GetExplTargetUnit ()
 
GameObject * GetExplTargetGObj ()
 
Item * GetExplTargetItem ()
 
Unit * GetHitUnit ()
 
Creature * GetHitCreature ()
 
Player * GetHitPlayer ()
 
Item * GetHitItem ()
 
GameObject * GetHitGObj ()
 
WorldLocation * GetHitDest ()
 
int32 GetHitDamage ()
 
void SetHitDamage (int32 damage)
 
void PreventHitDamage ()
 
int32 GetHitHeal ()
 
void SetHitHeal (int32 heal)
 
void PreventHitHeal ()
 
Spell * GetSpell ()
 
Aura * GetHitAura ()
 
void PreventHitAura ()
 
void PreventHitEffect (SpellEffIndex effIndex)
 
void PreventHitDefaultEffect (SpellEffIndex effIndex)
 
int32 GetEffectValue () const
 
void SetEffectValue (int32 value)
 
Item * GetCastItem ()
 
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 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< CastHandler > BeforeCast
 
HookList< CastHandler > OnCast
 
HookList< CastHandler > AfterCast
 
HookList< CheckCastHandler > OnCheckCast
 
HookList< EffectHandler > OnEffectLaunch
 
HookList< EffectHandler > OnEffectLaunchTarget
 
HookList< EffectHandler > OnEffectHit
 
HookList< EffectHandler > OnEffectHitTarget
 
HookList< BeforeHitHandler > BeforeHit
 
HookList< HitHandler > OnHit
 
HookList< HitHandler > AfterHit
 
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
 
HookList< ObjectTargetSelectHandler > OnObjectTargetSelect
 
HookList< DestinationTargetSelectHandler > OnDestinationTargetSelect
 
- 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
442 {
444 if (!player)
445 return;
446
447 uint32 spellId = 0;
448 switch (GetSpellInfo()->Id)
449 {
451 spellId = SPELL_PLAYER_TURKEY;
452 break;
454 spellId = SPELL_PLAYER_STUFFING;
455 break;
457 spellId = SPELL_PLAYER_PIE;
458 break;
460 spellId = SPELL_PLAYER_CRANBERRY;
461 break;
464 break;
465 }
466
467 if (spellId)
468 {
469 player->CastSpell(player, spellId, true);
470 if (AuraEffect* aur = player->GetAuraEffectDummy(spellId))
471 {
472 if (aur->GetBase()->GetStackAmount() >= 5)
473 {
474 switch (spellId)
475 {
477 player->CastSpell(player, SPELL_WELL_FED_TURKEY, true);
478 break;
480 player->CastSpell(player, SPELL_WELL_FED_STUFFING, true);
481 break;
482 case SPELL_PLAYER_PIE:
483 player->CastSpell(player, SPELL_WELL_FED_PIE, true);
484 break;
486 player->CastSpell(player, SPELL_WELL_FED_CRANBERRY, true);
487 break;
489 player->CastSpell(player, SPELL_WELL_FED_SWEET_POTATOES, true);
490 break;
491 }
492
493 uint8 count = 0;
495 for (Unit::AuraEffectList::const_iterator i = dummyAuras.begin(); i != dummyAuras.end(); ++i)
496 {
497 if ((*i)->GetId() >= SPELL_PLAYER_CRANBERRY && (*i)->GetId() <= SPELL_PLAYER_PIE)
498 if ((*i)->GetBase()->GetStackAmount() >= 5)
499 ++count;
500 }
501
502 // Cast spirit of sharing
503 if (count >= 5)
504 {
510 player->CastSpell(player, SPELL_SPIRIT_OF_SHARING, true);
511 }
512 }
513 }
514 }
515 }
std::uint8_t uint8
Definition Define.h:109
std::uint32_t uint32
Definition Define.h:107
@ SPELL_AURA_DUMMY
Definition SpellAuraDefines.h:67
Definition SpellAuraEffects.h:39
Definition Player.h:1086
SpellInfo const * GetSpellInfo()
Definition SpellScript.cpp:416
Unit * GetCaster()
Definition SpellScript.cpp:401
AuraEffectList const & GetAuraEffectsByType(AuraType type) const
Definition Unit.h:1433
std::vector< AuraEffect * > AuraEffectList
Definition Unit.h:681
Player * GetCharmerOrOwnerPlayerOrPlayerItself() const
Definition Unit.cpp:7503
AuraEffect * GetAuraEffectDummy(uint32 spellid) const
Definition Unit.cpp:5593
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:1372
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:4936
@ SPELL_FEAST_ON_PIE
Definition pilgrims_bounty.cpp:74
@ SPELL_PLAYER_TURKEY
Definition pilgrims_bounty.cpp:78
@ SPELL_WELL_FED_TURKEY
Definition pilgrims_bounty.cpp:84
@ SPELL_WELL_FED_SWEET_POTATOES
Definition pilgrims_bounty.cpp:88
@ SPELL_PLAYER_SWEET_POTATOES
Definition pilgrims_bounty.cpp:82
@ SPELL_WELL_FED_STUFFING
Definition pilgrims_bounty.cpp:85
@ SPELL_FEAST_ON_TURKEY
Definition pilgrims_bounty.cpp:72
@ SPELL_PLAYER_CRANBERRY
Definition pilgrims_bounty.cpp:81
@ SPELL_FEAST_ON_STUFFING
Definition pilgrims_bounty.cpp:73
@ SPELL_PLAYER_STUFFING
Definition pilgrims_bounty.cpp:79
@ SPELL_SPIRIT_OF_SHARING
Definition pilgrims_bounty.cpp:96
@ SPELL_PLAYER_PIE
Definition pilgrims_bounty.cpp:80
@ SPELL_FEAST_ON_SWEET_POTATOES
Definition pilgrims_bounty.cpp:76
@ SPELL_WELL_FED_PIE
Definition pilgrims_bounty.cpp:86
@ SPELL_WELL_FED_CRANBERRY
Definition pilgrims_bounty.cpp:87
@ SPELL_FEAST_ON_CRANBERRY
Definition pilgrims_bounty.cpp:75

References Unit::CastSpell(), Unit::GetAuraEffectDummy(), Unit::GetAuraEffectsByType(), SpellScript::GetCaster(), Unit::GetCharmerOrOwnerPlayerOrPlayerItself(), SpellScript::GetSpellInfo(), Unit::RemoveAurasDueToSpell(), 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.

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

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


The documentation for this class was generated from the following file: