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

Private Member Functions

 PrepareAuraScript (spell_midsummer_ribbon_pole) bool Validate(SpellInfo const *) override
 
void HandleEffectPeriodic (AuraEffect const *)
 
void HandleEffectApply (AuraEffect const *, AuraEffectHandleModes)
 
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 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 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
 
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

◆ HandleEffectApply()

void spell_midsummer_ribbon_pole::HandleEffectApply ( AuraEffect const *  ,
AuraEffectHandleModes   
)
inlineprivate
920 {
921 Unit* ar = GetTarget();
922 switch (urand(0, 2))
923 {
924 case 0:
926 break;
927 case 1:
929 break;
930 case 2:
931 default:
933 break;
934 }
935 }
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:44
@ SPELL_TEST_RIBBON_POLE_CHANNEL_RED
Definition: midsummer.cpp:607
@ SPELL_TEST_RIBBON_POLE_CHANNEL_PINK
Definition: midsummer.cpp:608
@ SPELL_TEST_RIBBON_POLE_CHANNEL_BLUE
Definition: midsummer.cpp:606
Definition: Unit.h:630
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:1167
Unit * GetTarget() const
Definition: SpellScript.cpp:1165

References Unit::CastSpell(), AuraScript::GetTarget(), SPELL_TEST_RIBBON_POLE_CHANNEL_BLUE, SPELL_TEST_RIBBON_POLE_CHANNEL_PINK, SPELL_TEST_RIBBON_POLE_CHANNEL_RED, and urand().

Referenced by Register().

◆ HandleEffectPeriodic()

void spell_midsummer_ribbon_pole::HandleEffectPeriodic ( AuraEffect const *  )
inlineprivate
888 {
890 if (Unit* target = GetTarget())
891 {
893 if (!cr)
894 {
896 target->RemoveAura(SPELL_TEST_RIBBON_POLE_CHANNEL_RED);
897 target->RemoveAura(SPELL_TEST_RIBBON_POLE_CHANNEL_PINK);
898 SetDuration(1);
899 return;
900 }
901
902 if (Aura* aur = target->GetAura(SPELL_RIBBON_POLE_XP))
903 aur->SetDuration(std::min(aur->GetDuration() + 3 * MINUTE * IN_MILLISECONDS, 60 * MINUTE * IN_MILLISECONDS));
904 else
905 {
906 target->CastSpell(target, SPELL_RIBBON_POLE_XP, true);
907
908 // Achievement
909 if ((GameTime::GetGameTime().count() - GetApplyTime()) > 60 && target->IsPlayer())
910 target->ToPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, 58934, 0, target);
911 }
912
913 // Achievement
914 if ((time(nullptr) - GetApplyTime()) > 60 && target->IsPlayer())
915 target->ToPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, 58934, 0, target);
916 }
917 }
constexpr auto IN_MILLISECONDS
Definition: Common.h:53
constexpr auto MINUTE
Definition: Common.h:47
@ SPELL_RIBBON_POLE_XP
Definition: midsummer.cpp:620
@ NPC_RIBBON_POLE_DEBUG_TARGET
Definition: midsummer.cpp:622
@ ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET
Definition: DBCEnums.h:142
Seconds GetGameTime()
Definition: GameTime.cpp:38
Definition: Creature.h:43
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition: Object.cpp:2457
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:4776
Definition: SpellAuras.h:87
void PreventDefaultAction()
Definition: SpellScript.cpp:985
time_t GetApplyTime() const
Definition: SpellScript.cpp:1070
void SetDuration(int32 duration, bool withMods=false)
Definition: SpellScript.cpp:1060

References ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, WorldObject::FindNearestCreature(), AuraScript::GetApplyTime(), GameTime::GetGameTime(), AuraScript::GetTarget(), IN_MILLISECONDS, MINUTE, NPC_RIBBON_POLE_DEBUG_TARGET, AuraScript::PreventDefaultAction(), Unit::RemoveAura(), AuraScript::SetDuration(), SPELL_RIBBON_POLE_XP, SPELL_TEST_RIBBON_POLE_CHANNEL_BLUE, SPELL_TEST_RIBBON_POLE_CHANNEL_PINK, and SPELL_TEST_RIBBON_POLE_CHANNEL_RED.

Referenced by Register().

◆ PrepareAuraScript()

spell_midsummer_ribbon_pole::PrepareAuraScript ( spell_midsummer_ribbon_pole  ) const
inlineoverrideprivate

◆ Register()

void spell_midsummer_ribbon_pole::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

938 {
941 }
@ EFFECT_0
Definition: SharedDefines.h:31
#define AuraEffectPeriodicFn(F, I, N)
Definition: SpellScript.h:760
#define AuraEffectApplyFn(F, I, N, M)
Definition: SpellScript.h:743
@ SPELL_AURA_PERIODIC_DUMMY
Definition: SpellAuraDefines.h:289
@ AURA_EFFECT_HANDLE_REAL
Definition: SpellAuraDefines.h:42
HookList< EffectPeriodicHandler > OnEffectPeriodic
Definition: SpellScript.h:759
HookList< EffectApplyHandler > OnEffectApply
Definition: SpellScript.h:738
void HandleEffectApply(AuraEffect const *, AuraEffectHandleModes)
Definition: midsummer.cpp:919
void HandleEffectPeriodic(AuraEffect const *)
Definition: midsummer.cpp:887

References AURA_EFFECT_HANDLE_REAL, AuraEffectApplyFn, AuraEffectPeriodicFn, EFFECT_0, HandleEffectApply(), HandleEffectPeriodic(), AuraScript::OnEffectApply, AuraScript::OnEffectPeriodic, and SPELL_AURA_PERIODIC_DUMMY.