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

Private Member Functions

 PrepareAuraScript (spell_love_is_in_the_air_romantic_picnic)
 
void OnApply (AuraEffect const *, AuraEffectHandleModes)
 
void OnPeriodic (AuraEffect const *)
 
void Register () override
 

Additional Inherited Members

- Public Member Functions inherited from AuraScript
 AuraScript ()
 
bool _Validate (SpellInfo const *entry) override
 
bool _Load (Aura *aura)
 
void _PrepareScriptCall (AuraScriptHookType hookType, AuraApplication const *aurApp=nullptr)
 
void _FinishScriptCall ()
 
bool _IsDefaultActionPrevented ()
 
void PreventDefaultAction ()
 
SpellInfo const * GetSpellInfo () const
 
uint32 GetId () const
 
ObjectGuid GetCasterGUID () const
 
Unit * GetCaster () const
 
WorldObject * GetOwner () const
 
Unit * GetUnitOwner () const
 
DynamicObject * GetDynobjOwner () const
 
void Remove (AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
 
Aura * GetAura () const
 
AuraObjectType GetType () const
 
int32 GetDuration () const
 
void SetDuration (int32 duration, bool withMods=false)
 
void RefreshDuration ()
 
time_t GetApplyTime () const
 
int32 GetMaxDuration () const
 
void SetMaxDuration (int32 duration)
 
int32 CalcMaxDuration () const
 
bool IsExpired () const
 
bool IsPermanent () const
 
uint8 GetCharges () const
 
void SetCharges (uint8 charges)
 
uint8 CalcMaxCharges () const
 
bool ModCharges (int8 num, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
 
bool DropCharge (AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
 
uint8 GetStackAmount () const
 
void SetStackAmount (uint8 num)
 
bool ModStackAmount (int32 num, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
 
bool IsPassive () const
 
bool IsDeathPersistent () const
 
bool HasEffect (uint8 effIndex) const
 
AuraEffect * GetEffect (uint8 effIndex) const
 
bool HasEffectType (AuraType type) const
 
Unit * GetTarget () const
 
AuraApplication const * GetTargetApplication () const
 
- 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 AuraScript
HookList< CheckAreaTargetHandler > DoCheckAreaTarget
 
HookList< AuraDispelHandler > OnDispel
 
HookList< AuraDispelHandler > AfterDispel
 
HookList< EffectApplyHandler > OnEffectApply
 
HookList< EffectApplyHandler > AfterEffectApply
 
HookList< EffectApplyHandler > OnEffectRemove
 
HookList< EffectApplyHandler > AfterEffectRemove
 
HookList< EffectPeriodicHandler > OnEffectPeriodic
 
HookList< EffectUpdatePeriodicHandler > OnEffectUpdatePeriodic
 
HookList< EffectCalcAmountHandler > DoEffectCalcAmount
 
HookList< EffectCalcPeriodicHandler > DoEffectCalcPeriodic
 
HookList< EffectCalcSpellModHandler > DoEffectCalcSpellMod
 
HookList< EffectAbsorbHandler > OnEffectAbsorb
 
HookList< EffectAbsorbHandler > AfterEffectAbsorb
 
HookList< EffectManaShieldHandler > OnEffectManaShield
 
HookList< EffectManaShieldHandler > AfterEffectManaShield
 
HookList< EffectSplitHandler > OnEffectSplit
 
HookList< CheckProcHandler > DoCheckProc
 
HookList< CheckEffectProcHandler > DoCheckEffectProc
 
HookList< AfterCheckProcHandler > DoAfterCheckProc
 
HookList< AuraProcHandler > DoPrepareProc
 
HookList< AuraProcHandler > OnProc
 
HookList< AuraProcHandler > AfterProc
 
HookList< EffectProcHandler > OnEffectProc
 
HookList< EffectProcHandler > AfterEffectProc
 
- Protected Attributes inherited from _SpellScript
uint8 m_currentScriptState
 
std::string const * m_scriptName
 
uint32 m_scriptSpellId
 

Detailed Description

Member Function Documentation

◆ OnApply()

void spell_love_is_in_the_air_romantic_picnic::OnApply ( AuraEffect const *  ,
AuraEffectHandleModes   
)
inlineprivate
381 {
382 Unit* target = GetTarget();
384 target->CastSpell(target, SPELL_MEAL_PERIODIC, false);
385 }
@ UNIT_STAND_STATE_SIT
Definition UnitDefines.h:36
Unit * GetTarget() const
Definition SpellScript.cpp:1185
Definition Unit.h:665
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 SetStandState(uint8 state)
Definition Unit.cpp:12731
@ SPELL_MEAL_PERIODIC
Definition love_in_air.cpp:369

References Unit::CastSpell(), AuraScript::GetTarget(), Unit::SetStandState(), SPELL_MEAL_PERIODIC, and UNIT_STAND_STATE_SIT.

Referenced by Register().

◆ OnPeriodic()

void spell_love_is_in_the_air_romantic_picnic::OnPeriodic ( AuraEffect const *  )
inlineprivate
388 {
389 // Every 5 seconds
390 Unit* target = GetTarget();
391 Unit* caster = GetCaster();
392
393 // If our player is no longer sit, remove all auras
394 if (target->getStandState() != UNIT_STAND_STATE_SIT)
395 {
397 target->RemoveAura(GetAura());
398 return;
399 }
400
401 target->CastSpell(target, SPELL_BASKET_CHECK, false); // unknown use, it targets Romantic Basket
402 target->CastSpell(target, RAND(SPELL_MEAL_EAT_VISUAL, SPELL_DRINK_VISUAL), false);
403
404 bool foundSomeone = false;
405 // For nearby players, check if they have the same aura. If so, cast Romantic Picnic (45123)
406 // required by achievement and "hearts" visual
407 std::list<Player*> playerList;
409 Acore::PlayerListSearcher<Acore::AnyPlayerInObjectRangeCheck> searcher(target, playerList, checker);
410 Cell::VisitObjects(target, searcher, INTERACTION_DISTANCE * 2);
411 for (std::list<Player*>::const_iterator itr = playerList.begin(); itr != playerList.end(); ++itr)
412 {
413 if ((*itr) != target && (*itr)->HasAura(GetId())) // && (*itr)->getStandState() == UNIT_STAND_STATE_SIT)
414 {
415 if (caster)
416 {
417 caster->CastSpell(*itr, SPELL_ROMANTIC_PICNIC_ACHIEV, true);
418 caster->CastSpell(target, SPELL_ROMANTIC_PICNIC_ACHIEV, true);
419 }
420 foundSomeone = true;
421 // break;
422 }
423 }
424
425 if (!foundSomeone && target->HasAura(SPELL_ROMANTIC_PICNIC_ACHIEV))
427 }
static First const & RAND(First const &first, Second const &second, Rest const &... rest)
Definition CreatureAIImpl.h:25
#define INTERACTION_DISTANCE
Definition ObjectDefines.h:24
Definition GridNotifiers.h:1380
Unit * GetCaster() const
Definition SpellScript.cpp:1040
Aura * GetAura() const
Definition SpellScript.cpp:1065
uint32 GetId() const
Definition SpellScript.cpp:1030
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:4797
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition Unit.cpp:5764
uint8 getStandState() const
Definition Unit.h:1783
@ SPELL_BASKET_CHECK
Definition love_in_air.cpp:368
@ SPELL_ROMANTIC_PICNIC_ACHIEV
Definition love_in_air.cpp:373
@ SPELL_DRINK_VISUAL
Definition love_in_air.cpp:372
@ SPELL_MEAL_EAT_VISUAL
Definition love_in_air.cpp:370
Definition GridNotifiers.h:548
static void VisitObjects(WorldObject const *obj, T &visitor, float radius)
Definition CellImpl.h:165

References Unit::CastSpell(), AuraScript::GetAura(), AuraScript::GetCaster(), AuraScript::GetId(), Unit::getStandState(), AuraScript::GetTarget(), Unit::HasAura(), INTERACTION_DISTANCE, RAND(), Unit::RemoveAura(), SPELL_BASKET_CHECK, SPELL_DRINK_VISUAL, SPELL_MEAL_EAT_VISUAL, SPELL_ROMANTIC_PICNIC_ACHIEV, UNIT_STAND_STATE_SIT, and Cell::VisitObjects().

Referenced by Register().

◆ PrepareAuraScript()

spell_love_is_in_the_air_romantic_picnic::PrepareAuraScript ( spell_love_is_in_the_air_romantic_picnic  )
private

◆ Register()

void spell_love_is_in_the_air_romantic_picnic::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

430 {
433 }
@ EFFECT_0
Definition SharedDefines.h:31
@ SPELL_AURA_PERIODIC_DUMMY
Definition SpellAuraDefines.h:289
@ AURA_EFFECT_HANDLE_REAL
Definition SpellAuraDefines.h:42
#define AuraEffectPeriodicFn(F, I, N)
Definition SpellScript.h:772
#define AuraEffectApplyFn(F, I, N, M)
Definition SpellScript.h:755
HookList< EffectPeriodicHandler > OnEffectPeriodic
Definition SpellScript.h:771
HookList< EffectApplyHandler > AfterEffectApply
Definition SpellScript.h:754
void OnApply(AuraEffect const *, AuraEffectHandleModes)
Definition love_in_air.cpp:380
void OnPeriodic(AuraEffect const *)
Definition love_in_air.cpp:387

References AuraScript::AfterEffectApply, AURA_EFFECT_HANDLE_REAL, AuraEffectApplyFn, AuraEffectPeriodicFn, EFFECT_0, OnApply(), AuraScript::OnEffectPeriodic, OnPeriodic(), and SPELL_AURA_PERIODIC_DUMMY.


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