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
 
UnitGetCaster () const
 
WorldObjectGetOwner () const
 
UnitGetUnitOwner () const
 
DynamicObjectGetDynobjOwner () const
 
void Remove (uint32 removeMode=0)
 
AuraGetAura () 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
 
AuraEffectGetEffect (uint8 effIndex) const
 
bool HasEffectType (AuraType type) const
 
UnitGetTarget () 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< CheckAreaTargetHandlerDoCheckAreaTarget
 
HookList< AuraDispelHandlerOnDispel
 
HookList< AuraDispelHandlerAfterDispel
 
HookList< EffectApplyHandlerOnEffectApply
 
HookList< EffectApplyHandlerAfterEffectApply
 
HookList< EffectApplyHandlerOnEffectRemove
 
HookList< EffectApplyHandlerAfterEffectRemove
 
HookList< EffectPeriodicHandlerOnEffectPeriodic
 
HookList< EffectUpdatePeriodicHandlerOnEffectUpdatePeriodic
 
HookList< EffectCalcAmountHandlerDoEffectCalcAmount
 
HookList< EffectCalcPeriodicHandlerDoEffectCalcPeriodic
 
HookList< EffectCalcSpellModHandlerDoEffectCalcSpellMod
 
HookList< EffectAbsorbHandlerOnEffectAbsorb
 
HookList< EffectAbsorbHandlerAfterEffectAbsorb
 
HookList< EffectManaShieldHandlerOnEffectManaShield
 
HookList< EffectManaShieldHandlerAfterEffectManaShield
 
HookList< EffectSplitHandlerOnEffectSplit
 
HookList< CheckProcHandlerDoCheckProc
 
HookList< AfterCheckProcHandlerDoAfterCheckProc
 
HookList< AuraProcHandlerDoPrepareProc
 
HookList< AuraProcHandlerOnProc
 
HookList< AuraProcHandlerAfterProc
 
HookList< EffectProcHandlerOnEffectProc
 
HookList< EffectProcHandlerAfterEffectProc
 
- 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:33
Unit * GetTarget() const
Definition SpellScript.cpp:1165
Definition Unit.h:636
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:1178
void SetStandState(uint8 state)
Definition Unit.cpp:16778
@ 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::VisitWorldObjects(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:1354
Unit * GetCaster() const
Definition SpellScript.cpp:1020
Aura * GetAura() const
Definition SpellScript.cpp:1045
uint32 GetId() const
Definition SpellScript.cpp:1010
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:4808
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition Unit.cpp:5753
uint8 getStandState() const
Definition Unit.h:1695
@ 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:525
static void VisitWorldObjects(WorldObject const *obj, T &visitor, float radius)
Definition CellImpl.h:175

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::VisitWorldObjects().

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:760
#define AuraEffectApplyFn(F, I, N, M)
Definition SpellScript.h:743
HookList< EffectPeriodicHandler > OnEffectPeriodic
Definition SpellScript.h:759
HookList< EffectApplyHandler > AfterEffectApply
Definition SpellScript.h:742
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: