AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
npc_midsummer_ribbon_pole_target Struct Reference
Inheritance diagram for npc_midsummer_ribbon_pole_target:
ScriptedAI CreatureAI UnitAI

Public Member Functions

 npc_midsummer_ribbon_pole_target (Creature *creature)
 
void SpellHit (Unit *caster, SpellInfo const *spell) override
 
void LocateRibbonPole ()
 
void SpawnFireSpiralBunny ()
 
void DoCleanupChecks ()
 
void DoFlameCircleChecks ()
 
void DoFireworkChecks ()
 
void DoGroundFlowerChecks ()
 
void DoSpewLavaChecks ()
 
void DoDancingFLameChecks ()
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
- Public Member Functions inherited from ScriptedAI
 ScriptedAI (Creature *creature)
 
 ~ScriptedAI () override
 
void AttackStartNoMove (Unit *target)
 
void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask) override
 Called at any Damage from any attacker (before damage apply)
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
void JustDied (Unit *) override
 
void KilledUnit (Unit *) override
 
void JustSummoned (Creature *) override
 
void SummonedCreatureDespawn (Creature *) override
 
void SpellHit (Unit *, SpellInfo const *) override
 
void SpellHitTarget (Unit *, SpellInfo const *) override
 
void MovementInform (uint32, uint32) override
 
void OnPossess (bool)
 
bool IsInRoom (const Position *pos, Axis axis, bool above)
 
void Reset () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged.
 
void AttackStart (Unit *) override
 
void DoStartMovement (Unit *target, float distance=0.0f, float angle=0.0f)
 
void DoStartNoMovement (Unit *target)
 
void DoStopAttack ()
 
void DoCastSpell (Unit *target, SpellInfo const *spellInfo, bool triggered=false)
 
void DoPlaySoundToSet (WorldObject *source, uint32 soundId)
 
void DoPlayMusic (uint32 soundId, bool zone)
 
void DoAddThreat (Unit *unit, float amount)
 
void DoModifyThreatByPercent (Unit *unit, int32 pct)
 
void DoResetThreat (Unit *unit)
 
void DoResetThreatList ()
 
float DoGetThreat (Unit *unit)
 
void DoTeleportPlayer (Unit *unit, float x, float y, float z, float o)
 
void DoTeleportPlayer (Unit *unit, Position pos)
 
void DoTeleportAll (float x, float y, float z, float o)
 
UnitDoSelectLowestHpFriendly (float range, uint32 minHPDiff=1)
 
std::list< Creature * > DoFindFriendlyCC (float range)
 
std::list< Creature * > DoFindFriendlyMissingBuff (float range, uint32 spellId)
 
PlayerGetPlayerAtMinimumRange (float minRange)
 
CreatureDoSpawnCreature (uint32 entry, float offsetX, float offsetY, float offsetZ, float angle, uint32 type, uint32 despawntime)
 
bool IsUniqueTimedEventDone (uint32 id) const
 
void SetUniqueTimedEventDone (uint32 id)
 
void ResetUniqueTimedEvent (uint32 id)
 
void ClearUniqueTimedEventsDone ()
 
void ScheduleTimedEvent (Milliseconds timerMin, Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0s, uint32 uniqueId=0)
 
void ScheduleTimedEvent (Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0s, uint32 uniqueId=0)
 
void ScheduleUniqueTimedEvent (Milliseconds timer, std::function< void()> exec, uint32 uniqueId)
 
bool HealthBelowPct (uint32 pct) const
 
bool HealthAbovePct (uint32 pct) const
 
SpellInfo const * SelectSpell (Unit *target, uint32 school, uint32 mechanic, SelectTargetType targets, uint32 powerCostMin, uint32 powerCostMax, float rangeMin, float rangeMax, SelectEffect effect)
 
void SetEquipmentSlots (bool loadDefault, int32 mainHand=EQUIP_NO_CHANGE, int32 offHand=EQUIP_NO_CHANGE, int32 ranged=EQUIP_NO_CHANGE)
 
virtual bool CheckEvadeIfOutOfCombatArea () const
 
bool IsHeroic () const
 
Difficulty GetDifficulty () const
 
bool Is25ManRaid () const
 
template<class T >
const T & DUNGEON_MODE (const T &normal5, const T &heroic10) const
 
template<class T >
const T & RAID_MODE (const T &normal10, const T &normal25) const
 
template<class T >
const T & RAID_MODE (const T &normal10, const T &normal25, const T &heroic10, const T &heroic25) const
 
PlayerSelectTargetFromPlayerList (float maxdist, uint32 excludeAura=0, bool mustBeInLOS=false) const
 
void SetInvincibility (bool apply)
 
bool IsInvincible () const
 
void SetAutoAttackAllowed (bool allow)
 
bool IsAutoAttackAllowed () const
 
- Public Member Functions inherited from CreatureAI
void Talk (uint8 id, WorldObject const *whisperTarget=nullptr, Milliseconds delay=0s)
 Causes the creature to talk/say the text assigned to their entry in the creature_text database table.
 
void Talk (uint8 id, Milliseconds delay)
 
WorldObjectGetSummoner () const
 Returns the summoner creature/object, if the creature is a temporary summon.
 
 CreatureAI (Creature *creature)
 
 ~CreatureAI () override
 
void MoveCircleChecks ()
 
void MoveBackwardsChecks ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At =================================
 
void TriggerAlert (Unit const *who) const
 
virtual bool CanRespawn ()
 
virtual void EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
virtual void IsSummonedBy (WorldObject *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void SummonedCreatureDespawnAll ()
 
virtual void SummonedCreatureEvade (Creature *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted ()
 
virtual void JustRespawned ()
 
virtual void PathEndReached (uint32)
 
void OnCharmed (bool apply) override
 Called when unit is charmed.
 
virtual void JustReachedHome ()
 
void DoZoneInCombat (Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
 
virtual void ReceiveEmote (Player *, uint32)
 
virtual void OwnerAttackedBy (Unit *)
 
virtual void OwnerAttacked (Unit *)
 
virtual void CorpseRemoved (uint32 &)
 == Triggered Actions Requested ==================
 
virtual void PassengerBoarded (Unit *, int8, bool)
 == Fields =======================================
 
virtual bool BeforeSpellClick (Unit *)
 
virtual void OnSpellClick (Unit *, bool &)
 
virtual bool CanSeeAlways (WorldObject const *)
 
virtual bool CanBeSeen (Player const *)
 
virtual bool CanAlwaysBeDetectable (WorldObject const *)
 
virtual void PetStopAttack ()
 
int32 VisualizeBoundary (uint32 duration, Unit *owner=nullptr, bool fill=false, bool checkZ=false) const
 
virtual bool CheckInRoom ()
 
CreatureBoundary const * GetBoundary () const
 
void SetBoundary (CreatureBoundary const *boundary, bool negativeBoundaries=false)
 
bool IsInBoundary (Position const *who=nullptr) const
 
virtual void CalculateThreat (Unit *, float &, SpellInfo const *)
 
virtual bool OnTeleportUnreacheablePlayer (Player *)
 
virtual void OnAuraRemove (AuraApplication *, AuraRemoveMode)
 
- Public Member Functions inherited from UnitAI
 UnitAI (Unit *unit)
 
virtual ~UnitAI ()
 
virtual bool CanAIAttack (Unit const *) const
 
virtual void InitializeAI ()
 
virtual void DoAction (int32)
 
virtual uint32 GetData (uint32) const
 
virtual void SetData (uint32, uint32)
 
virtual void SetGUID (ObjectGuid, int32=0)
 
virtual ObjectGuid GetGUID (int32=0) const
 
UnitSelectTarget (SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 
template<class PREDICATE >
UnitSelectTarget (SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 Select the best (up to) <num> targets (in <targetType> order) from the threat list that fulfill the following:
 
template<class PREDICATE >
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
virtual void JustEnteredCombat (Unit *)
 Called when the unit enters combat.
 
virtual void JustExitedCombat ()
 Called when the unit leaves combat.
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
 Called at any Damage to any victim (before damage apply)
 
virtual void HealReceived (Unit *, uint32 &)
 Called when the creature receives heal.
 
virtual void OnPowerUpdate (Powers, int32, int32, uint32)
 Called when the creature power updates.
 
virtual void HealDone (Unit *, uint32 &)
 Called when the unit heals.
 
virtual void OnCalculateMeleeDamageReceived (uint32 &, Unit *)
 Called during damage calculations.
 
virtual void OnCalculateSpellDamageReceived (int32 &, Unit *)
 
virtual void OnCalculatePeriodicTickReceived (uint32 &, Unit *)
 Called during calculation when receiving periodic healing or damage (DoT or HoT)
 
void AttackStartCaster (Unit *victim, float dist)
 
SpellCastResult DoAddAuraToAllHostilePlayers (uint32 spellid)
 
SpellCastResult DoCast (uint32 spellId)
 
SpellCastResult DoCast (Unit *victim, uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastSelf (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastToAllHostilePlayers (uint32 spellid, bool triggered=false)
 To specify the caster as target if the spell is self-cast.
 
SpellCastResult DoCastVictim (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastAOE (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastRandomTarget (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false, bool withTank=true)
 Cast the spell on a random unit from the threat list.
 
SpellCastResult DoCastMaxThreat (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false)
 Cast spell on the top threat target, which may not be the current victim.
 
float DoGetSpellMaxRange (uint32 spellId, bool positive=false)
 
void DoMeleeAttackIfReady ()
 
bool DoSpellAttackIfReady (uint32 spell)
 
void DoSpellAttackToRandomTargetIfReady (uint32 spell, uint32 threatTablePosition=0, float dist=0.f, bool playerOnly=true)
 
virtual void SummonMovementInform (Creature *, uint32, uint32)
 Called when a summon reaches a waypoint or point movement finished.
 
virtual void sGossipHello (Player *)
 
virtual void sGossipSelect (Player *, uint32, uint32)
 
virtual void sGossipSelectCode (Player *, uint32, uint32, char const *)
 
virtual void sQuestAccept (Player *, Quest const *)
 
virtual void sQuestSelect (Player *, Quest const *)
 
virtual void sQuestComplete (Player *, Quest const *)
 
virtual void sQuestReward (Player *, Quest const *, uint32)
 
virtual void sOnGameEvent (bool, uint16)
 
virtual std::string GetDebugInfo () const
 

Private Attributes

GuidVector _dancerList
 
GameObject_ribbonPole
 
Creature_bunny
 

Additional Inherited Members

- Public Types inherited from ScriptedAI
enum class  Axis {
  AXIS_X ,
  AXIS_Y
}
 
- Public Types inherited from CreatureAI
enum  EvadeReason {
  EVADE_REASON_NO_HOSTILES ,
  EVADE_REASON_BOUNDARY ,
  EVADE_REASON_SEQUENCE_BREAK ,
  EVADE_REASON_NO_PATH ,
  EVADE_REASON_OTHER
}
 
- Static Public Member Functions inherited from CreatureAI
static bool IsInBounds (CreatureBoundary const &boundary, Position const *who)
 
- Static Public Member Functions inherited from UnitAI
static void FillAISpellInfo ()
 
- Public Attributes inherited from ScriptedAI
Creatureme
 
- Static Public Attributes inherited from UnitAI
static AISpellInfoTypeAISpellInfo
 
- Protected Member Functions inherited from CreatureAI
bool UpdateVictim ()
 
bool UpdateVictimWithGaze ()
 
void SetGazeOn (Unit *target)
 
CreatureDoSummon (uint32 entry, Position const &pos, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
CreatureDoSummon (uint32 entry, WorldObject *obj, float radius=5.0f, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
CreatureDoSummonFlyer (uint32 entry, WorldObject *obj, float flightZ, float radius=5.0f, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
virtual void MoveInLineOfSight (Unit *)
 
bool _EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
- Protected Attributes inherited from CreatureAI
Creature *const me
 
EventMap events
 
TaskScheduler scheduler
 
CreatureBoundary const * _boundary
 
bool _negateBoundary
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Detailed Description

Constructor & Destructor Documentation

◆ npc_midsummer_ribbon_pole_target()

npc_midsummer_ribbon_pole_target::npc_midsummer_ribbon_pole_target ( Creature creature)
inline
640 : ScriptedAI(creature)
641 {
642 // ribbonPole trap also spawns this NPC (currently unwanted)
643 if (me->ToTempSummon())
645
646 _ribbonPole = nullptr;
647 _bunny = nullptr;
648 _dancerList.clear();
649
652
653 scheduler.Schedule(1s, [this](TaskContext context)
654 {
656 context.Repeat();
657 })
658 .Schedule(5s, [this](TaskContext context)
659 {
661 context.Repeat();
662 })
663 .Schedule(15s, [this](TaskContext context)
664 {
666 context.Repeat();
667 })
668 .Schedule(10s, [this](TaskContext context)
669 {
671 context.Repeat();
672 })
673 .Schedule(10s, [this](TaskContext context)
674 {
676 context.Repeat();
677 })
678 .Schedule(15s, [this](TaskContext context)
679 {
681 context.Repeat();
682 });
683 }
TaskScheduler scheduler
Definition CreatureAI.h:75
void DespawnOrUnsummon(Milliseconds msTimeToDespawn, Seconds forcedRespawnTimer)
Definition Creature.cpp:2177
Definition TaskScheduler.h:421
TaskContext & Repeat(std::chrono::duration< _Rep, _Period > const &duration)
Definition TaskScheduler.h:493
TaskScheduler & Schedule(std::chrono::duration< _Rep, _Period > const &time, task_handler_t const &task)
Definition TaskScheduler.h:232
TempSummon * ToTempSummon()
Definition Unit.h:686
Definition ScriptedCreature.h:190
Creature * me
Definition ScriptedCreature.h:280
Creature * _bunny
Definition midsummer.cpp:850
void DoGroundFlowerChecks()
Definition midsummer.cpp:787
void DoFireworkChecks()
Definition midsummer.cpp:754
GuidVector _dancerList
Definition midsummer.cpp:848
void LocateRibbonPole()
Definition midsummer.cpp:708
void DoCleanupChecks()
Definition midsummer.cpp:727
void DoSpewLavaChecks()
Definition midsummer.cpp:802
void SpawnFireSpiralBunny()
Definition midsummer.cpp:719
GameObject * _ribbonPole
Definition midsummer.cpp:849
void DoFlameCircleChecks()
Definition midsummer.cpp:740
void DoDancingFLameChecks()
Definition midsummer.cpp:826

References _bunny, _dancerList, _ribbonPole, Creature::DespawnOrUnsummon(), DoCleanupChecks(), DoDancingFLameChecks(), DoFireworkChecks(), DoFlameCircleChecks(), DoGroundFlowerChecks(), DoSpewLavaChecks(), LocateRibbonPole(), ScriptedAI::me, TaskContext::Repeat(), TaskScheduler::Schedule(), CreatureAI::scheduler, SpawnFireSpiralBunny(), and Unit::ToTempSummon().

Member Function Documentation

◆ DoCleanupChecks()

void npc_midsummer_ribbon_pole_target::DoCleanupChecks ( )
inline
728 {
729 if (_dancerList.empty())
730 return;
731
732 // remove non-dancing players from list
733 std::erase_if(_dancerList, [this](ObjectGuid dancerGUID)
734 {
735 Player* dancer = ObjectAccessor::GetPlayer(*me, dancerGUID);
736 return !dancer || !dancer->HasAura(SPELL_RIBBON_POLE_PERIODIC_VISUAL);
737 });
738 }
Definition ObjectGuid.h:118
Definition Player.h:1082
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition Unit.cpp:5754
@ SPELL_RIBBON_POLE_PERIODIC_VISUAL
Definition midsummer.cpp:607
Player * GetPlayer(Map const *, ObjectGuid const guid)
Definition ObjectAccessor.cpp:220

References _dancerList, ObjectAccessor::GetPlayer(), Unit::HasAura(), ScriptedAI::me, and SPELL_RIBBON_POLE_PERIODIC_VISUAL.

Referenced by npc_midsummer_ribbon_pole_target().

◆ DoDancingFLameChecks()

void npc_midsummer_ribbon_pole_target::DoDancingFLameChecks ( )
inline
827 {
829 {
830 std::list<Creature*> crList;
832
833 if (crList.size() < MAX_COUNT_DANCING_FLAMES)
834 {
835 float spawnDist = 12.0f;
836 float angle = rand_norm() * 2 * M_PI;
837 DoSpawnCreature(NPC_BIG_DANCING_FLAMES, spawnDist * cos(angle), spawnDist * std::sin(angle), 0, angle + M_PI, TEMPSUMMON_TIMED_DESPAWN, 60000);
838 }
839 }
840 }
@ TEMPSUMMON_TIMED_DESPAWN
Definition Object.h:49
double rand_norm()
Definition Random.cpp:85
void GetCreaturesWithEntryInRange(std::list< Creature * > &creatureList, float radius, uint32 entry)
Definition Object.cpp:3097
@ MAX_COUNT_DANCING_FLAMES
Definition midsummer.cpp:635
@ NPC_BIG_DANCING_FLAMES
Definition midsummer.cpp:621
@ THRESHOLD_DANCING_FLAMES
Definition midsummer.cpp:631
Creature * DoSpawnCreature(uint32 entry, float offsetX, float offsetY, float offsetZ, float angle, uint32 type, uint32 despawntime)
Definition ScriptedCreature.cpp:316

References _dancerList, ScriptedAI::DoSpawnCreature(), WorldObject::GetCreaturesWithEntryInRange(), MAX_COUNT_DANCING_FLAMES, ScriptedAI::me, NPC_BIG_DANCING_FLAMES, rand_norm(), TEMPSUMMON_TIMED_DESPAWN, and THRESHOLD_DANCING_FLAMES.

Referenced by npc_midsummer_ribbon_pole_target().

◆ DoFireworkChecks()

void npc_midsummer_ribbon_pole_target::DoFireworkChecks ( )
inline
755 {
756 if (!_bunny)
757 return;
758
759 if (_dancerList.size() >= THRESHOLD_FIREWORK)
760 {
762 }
763 if (_dancerList.size() >= THRESHOLD_FIREWORK_3)
764 {
765 scheduler.Schedule(500ms, [this](TaskContext /*context*/)
766 {
768 })
769 .Schedule(1s, [this](TaskContext /*context*/)
770 {
772 });
773 }
774 if (_dancerList.size() >= THRESHOLD_FIREWORK_5)
775 {
776 scheduler.Schedule(1500ms, [this](TaskContext /*context*/)
777 {
779 })
780 .Schedule(2s, [this](TaskContext /*context*/)
781 {
783 });
784 }
785 }
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:1179
@ THRESHOLD_FIREWORK
Definition midsummer.cpp:626
@ SPELL_RIBBON_POLE_FIREWORK
Definition midsummer.cpp:615
@ THRESHOLD_FIREWORK_5
Definition midsummer.cpp:628
@ THRESHOLD_FIREWORK_3
Definition midsummer.cpp:627

References _bunny, _dancerList, Unit::CastSpell(), TaskScheduler::Schedule(), CreatureAI::scheduler, SPELL_RIBBON_POLE_FIREWORK, THRESHOLD_FIREWORK, THRESHOLD_FIREWORK_3, and THRESHOLD_FIREWORK_5.

Referenced by npc_midsummer_ribbon_pole_target().

◆ DoFlameCircleChecks()

void npc_midsummer_ribbon_pole_target::DoFlameCircleChecks ( )
inline
741 {
742 if (!_ribbonPole)
743 return;
745 {
746 // random blue / red circle
747 if (urand(0, 1))
749 else
751 }
752 }
uint32 urand(uint32 min, uint32 max)
Definition Random.cpp:44
void CastSpell(Unit *target, uint32 spell)
Definition GameObject.cpp:2070
@ THRESHOLD_FLAME_CIRCLE
Definition midsummer.cpp:625
@ SPELL_FLAME_RING
Definition midsummer.cpp:611
@ SPELL_FLAME_PATCH
Definition midsummer.cpp:613

References _dancerList, _ribbonPole, GameObject::CastSpell(), ScriptedAI::me, SPELL_FLAME_PATCH, SPELL_FLAME_RING, THRESHOLD_FLAME_CIRCLE, and urand().

Referenced by npc_midsummer_ribbon_pole_target().

◆ DoGroundFlowerChecks()

void npc_midsummer_ribbon_pole_target::DoGroundFlowerChecks ( )
inline
788 {
789 if (!_bunny)
790 return;
791
793 {
794 std::list<Creature*> crList;
796
797 if (crList.size() < MAX_COUNT_GROUND_FLOWERS)
799 }
800 }
@ MAX_COUNT_GROUND_FLOWERS
Definition midsummer.cpp:633
@ SPELL_RIBBON_POLE_GROUND_FLOWER
Definition midsummer.cpp:616
@ THRESHOLD_GROUND_FLOWERS
Definition midsummer.cpp:629
@ NPC_GROUND_FLOWER
Definition midsummer.cpp:620

References _bunny, _dancerList, Unit::CastSpell(), WorldObject::GetCreaturesWithEntryInRange(), MAX_COUNT_GROUND_FLOWERS, ScriptedAI::me, NPC_GROUND_FLOWER, SPELL_RIBBON_POLE_GROUND_FLOWER, and THRESHOLD_GROUND_FLOWERS.

Referenced by npc_midsummer_ribbon_pole_target().

◆ DoSpewLavaChecks()

void npc_midsummer_ribbon_pole_target::DoSpewLavaChecks ( )
inline
803 {
804 if (!_bunny)
805 return;
806
807 if (_dancerList.size() >= THRESHOLD_SPEW_LAVA)
808 {
809 if (!_dancerList.empty())
810 {
812
813 for (uint8 i = 0; (i < MAX_COUNT_SPEW_LAVA_TARGETS) && (i < _dancerList.size()); i++)
814 {
815 if (Player* dancerTarget = ObjectAccessor::GetPlayer(*me, _dancerList[i]))
816 {
817 Creature* fireSpiralBunny = dancerTarget->SummonCreature(NPC_RIBBON_POLE_FIRE_SPIRAL_BUNNY, dancerTarget->GetPositionX(), dancerTarget->GetPositionY(), dancerTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 10000);
818 if (fireSpiralBunny)
820 }
821 }
822 }
823 }
824 }
std::uint8_t uint8
Definition Define.h:109
Definition Creature.h:43
TempSummon * SummonCreature(uint32 id, const Position &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0, SummonPropertiesEntry const *properties=nullptr, bool visibleBySummonerOnly=false) const
Definition Object.cpp:2368
@ SPELL_RIBBON_POLE_FIRE_SPIRAL_VISUAL
Definition midsummer.cpp:609
@ THRESHOLD_SPEW_LAVA
Definition midsummer.cpp:630
@ NPC_RIBBON_POLE_FIRE_SPIRAL_BUNNY
Definition midsummer.cpp:622
@ MAX_COUNT_SPEW_LAVA_TARGETS
Definition midsummer.cpp:634
void RandomShuffle(C &container)
Definition Containers.h:230

References _bunny, _dancerList, Unit::CastSpell(), ObjectAccessor::GetPlayer(), MAX_COUNT_SPEW_LAVA_TARGETS, ScriptedAI::me, NPC_RIBBON_POLE_FIRE_SPIRAL_BUNNY, Acore::Containers::RandomShuffle(), SPELL_RIBBON_POLE_FIRE_SPIRAL_VISUAL, WorldObject::SummonCreature(), TEMPSUMMON_TIMED_DESPAWN, and THRESHOLD_SPEW_LAVA.

Referenced by npc_midsummer_ribbon_pole_target().

◆ LocateRibbonPole()

void npc_midsummer_ribbon_pole_target::LocateRibbonPole ( )
inline
709 {
710 scheduler.Schedule(420ms, [this](TaskContext context)
711 {
713
714 if (!_ribbonPole)
715 context.Repeat(420ms);
716 });
717 }
GameObject * FindNearestGameObject(uint32 entry, float range, bool onlySpawned=false) const
Definition Object.cpp:2468
@ GO_RIBBON_POLE
Definition midsummer.cpp:599

References _ribbonPole, WorldObject::FindNearestGameObject(), GO_RIBBON_POLE, ScriptedAI::me, TaskContext::Repeat(), TaskScheduler::Schedule(), and CreatureAI::scheduler.

Referenced by npc_midsummer_ribbon_pole_target().

◆ SpawnFireSpiralBunny()

void npc_midsummer_ribbon_pole_target::SpawnFireSpiralBunny ( )
inline
720 {
722
723 if (!_bunny)
725 }
@ TEMPSUMMON_MANUAL_DESPAWN
Definition Object.h:54
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition Object.cpp:2459

References _bunny, ScriptedAI::DoSpawnCreature(), WorldObject::FindNearestCreature(), ScriptedAI::me, NPC_RIBBON_POLE_FIRE_SPIRAL_BUNNY, and TEMPSUMMON_MANUAL_DESPAWN.

Referenced by npc_midsummer_ribbon_pole_target().

◆ SpellHit()

void npc_midsummer_ribbon_pole_target::SpellHit ( Unit caster,
SpellInfo const *  spell 
)
inlineoverridevirtual

Reimplemented from CreatureAI.

686 {
687 Player* dancer = caster->ToPlayer();
688 if (!dancer)
689 return;
690
691 switch (spell->Id)
692 {
696 break;
697 default:
698 return;
699 }
700
701 // prevent duplicates
702 if (std::find(_dancerList.begin(), _dancerList.end(), dancer->GetGUID()) != _dancerList.end())
703 return;
704
705 _dancerList.push_back(dancer->GetGUID());
706 }
Player * ToPlayer()
Definition Object.h:202
static ObjectGuid GetGUID(Object const *o)
Definition Object.h:113
@ SPELL_TEST_RIBBON_POLE_CHANNEL_RED
Definition midsummer.cpp:604
@ SPELL_TEST_RIBBON_POLE_CHANNEL_PINK
Definition midsummer.cpp:605
@ SPELL_TEST_RIBBON_POLE_CHANNEL_BLUE
Definition midsummer.cpp:603

References _dancerList, Object::GetGUID(), SpellInfo::Id, SPELL_TEST_RIBBON_POLE_CHANNEL_BLUE, SPELL_TEST_RIBBON_POLE_CHANNEL_PINK, SPELL_TEST_RIBBON_POLE_CHANNEL_RED, and Object::ToPlayer().

◆ UpdateAI()

void npc_midsummer_ribbon_pole_target::UpdateAI ( uint32  )
inlineoverridevirtual

Use to start attacking a target. Called just before JustEngagedWith()

Implements UnitAI.

843 {
844 scheduler.Update(diff);
845 }
TaskScheduler & Update(success_t const &callback=EmptyCallback)
Definition TaskScheduler.cpp:27

References CreatureAI::scheduler, and TaskScheduler::Update().

Member Data Documentation

◆ _bunny

◆ _dancerList

◆ _ribbonPole

GameObject* npc_midsummer_ribbon_pole_target::_ribbonPole
private

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