TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
npc_simon_bunny::npc_simon_bunnyAI Struct Reference

Public Member Functions

 npc_simon_bunnyAI (Creature *creature)
 
void UpdateAI (uint32 diff) override
 
void DoAction (int32 action) override
 
void SetData (uint32 type, uint32) override
 
void SetGUID (ObjectGuid guid, int32 id) override
 
void StartGame ()
 
void ResetNode ()
 
void CheckPlayerSequence ()
 
void GenerateColorSequence ()
 
void PrepareClusters (bool clustersOnly=false)
 
void PlayNextColor ()
 
void PlayColor (uint8 color)
 
void SetUpPreGame ()
 
void GiveRewardForLevel (uint8 level)
 
void GivePunishment ()
 
void SpellHitTarget (Unit *target, const SpellInfo *spell) override
 
bool CheckPlayer ()
 
- Public Member Functions inherited from ScriptedAI
 ScriptedAI (Creature *creature)
 
virtual ~ScriptedAI ()
 
void AttackStartNoMove (Unit *target)
 
void DamageTaken (Unit *, uint32 &) override
 
void JustDied (Unit *) override
 
void KilledUnit (Unit *) override
 
void JustSummoned (Creature *) override
 
void SummonedCreatureDespawn (Creature *) override
 
void SpellHit (Unit *, SpellInfo const *) override
 
void OnPossess (bool)
 
void Reset () override
 
void EnterCombat (Unit *) override
 
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 DoResetThreat ()
 
float DoGetThreat (Unit *unit)
 
void DoModifyThreatPercent (Unit *unit, int32 pct)
 
void DoTeleportTo (float x, float y, float z, uint32 time=0)
 
void DoTeleportTo (float const pos[4])
 
void DoTeleportPlayer (Unit *unit, float x, float y, float z, float o)
 
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 HealthBelowPct (uint32 pct) const
 
bool HealthAbovePct (uint32 pct) const
 
SpellInfo constSelectSpell (Unit *target, uint32 school, uint32 mechanic, SelectTargetType targets, 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)
 
void SetCombatMovement (bool allowMovement)
 
bool IsCombatMovementAllowed () 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
 
- Public Member Functions inherited from CreatureAI
void Talk (uint8 id, WorldObject const *whisperTarget=nullptr)
 
 CreatureAI (Creature *creature)
 
virtual ~CreatureAI ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At ================================= More...
 
void TriggerAlert (Unit const *who) const
 
virtual bool CanRespawn ()
 
virtual void EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
virtual void IsSummonedBy (Unit *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted () const
 
virtual void JustRespawned ()
 
virtual void MovementInform (uint32, uint32)
 
void OnCharmed (bool apply) override
 
virtual void JustReachedHome ()
 
void DoZoneInCombat (Creature *creature=NULL, float maxRangeToNearestTarget=50.0f)
 
virtual void ReceiveEmote (Player *, uint32)
 
virtual void OwnerAttackedBy (Unit *)
 
virtual void OwnerAttacked (Unit *)
 
virtual void CorpseRemoved (uint32 &)
 == Triggered Actions Requested ================== More...
 
virtual void PassengerBoarded (Unit *, int8, bool)
 == Fields ======================================= More...
 
virtual void OnSpellClick (Unit *, bool &)
 
virtual bool CanSeeAlways (WorldObject const *)
 
int32 VisualizeBoundary (uint32 duration, Unit *owner=nullptr, bool fill=false) const
 
virtual bool CheckInRoom ()
 
CreatureBoundary constGetBoundary () const
 
- Public Member Functions inherited from UnitAI
 UnitAI (Unit *unit)
 
virtual ~UnitAI ()
 
virtual bool CanAIAttack (Unit const *) const
 
virtual void InitializeAI ()
 
virtual uint32 GetData (uint32) const
 
virtual ObjectGuid GetGUID (int32=0) const
 
UnitSelectTarget (SelectAggroTarget targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, int32 aura=0)
 
template<class PREDICATE >
UnitSelectTarget (SelectAggroTarget targetType, uint32 position, PREDICATE const &predicate)
 
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectAggroTarget targetType, float dist=0.0f, bool playerOnly=false, int32 aura=0)
 
template<class PREDICATE >
void SelectTargetList (std::list< Unit * > &targetList, PREDICATE const &predicate, uint32 maxTargets, SelectAggroTarget targetType)
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType)
 
virtual void HealReceived (Unit *, uint32 &)
 
virtual void HealDone (Unit *, uint32 &)
 
virtual void SpellInterrupted (uint32, uint32)
 
void AttackStartCaster (Unit *victim, float dist)
 
void DoCast (uint32 spellId)
 
void DoCast (Unit *victim, uint32 spellId, bool triggered=false)
 
void DoCastVictim (uint32 spellId, bool triggered=false)
 
void DoCastAOE (uint32 spellId, bool triggered=false)
 
void DoMeleeAttackIfReady ()
 
bool DoSpellAttackIfReady (uint32 spellId)
 
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 sQuestReward (Player *, Quest const *, uint32)
 
virtual bool sOnDummyEffect (Unit *, uint32, SpellEffIndex)
 
virtual void sOnGameEvent (bool, uint16)
 

Public Attributes

bool large
 
bool listening
 
uint8 gameLevel
 
uint8 fails
 
uint8 gameTicks
 
ObjectGuid playerGUID
 
uint32 clusterIds [SIMON_MAX_COLORS]
 
float zCoordCorrection
 
float searchDistance
 
EventMap _events
 
std::list< uint8colorSequence
 
std::list< uint8playableSequence
 
std::list< uint8playerSequence
 
- Public Attributes inherited from ScriptedAI
bool IsFleeing
 

Additional Inherited Members

- Public Types inherited from CreatureAI
enum  EvadeReason { EVADE_REASON_NO_HOSTILES, EVADE_REASON_BOUNDARY, EVADE_REASON_SEQUENCE_BREAK, EVADE_REASON_OTHER }
 
- Static Public Member Functions inherited from UnitAI
static void FillAISpellInfo ()
 
- 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)
 
bool CheckBoundary (Position const *who=nullptr) const
 
void SetBoundary (CreatureBoundary const *boundary)
 
virtual void MoveInLineOfSight (Unit *)
 
bool _EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
- Protected Attributes inherited from CreatureAI
Creature *const me
 
CreatureBoundary const_boundary
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Constructor & Destructor Documentation

npc_simon_bunny::npc_simon_bunnyAI::npc_simon_bunnyAI ( Creature creature)
inline
420  : ScriptedAI(creature)
421  {
422  large = false;
423  listening = false;
424  gameLevel = 0;
425  fails = 0;
426  gameTicks = 0;
427  memset(clusterIds, 0, sizeof(clusterIds));
428  zCoordCorrection = 0.f;
429  searchDistance = 0.f;
430  }
uint8 gameTicks
Definition: zone_blades_edge_mountains.cpp:436
ScriptedAI(Creature *creature)
Definition: ScriptedCreature.cpp:100
float zCoordCorrection
Definition: zone_blades_edge_mountains.cpp:439
bool listening
Definition: zone_blades_edge_mountains.cpp:433
uint32 clusterIds[SIMON_MAX_COLORS]
Definition: zone_blades_edge_mountains.cpp:438
float searchDistance
Definition: zone_blades_edge_mountains.cpp:440
uint8 gameLevel
Definition: zone_blades_edge_mountains.cpp:434
bool large
Definition: zone_blades_edge_mountains.cpp:432
uint8 fails
Definition: zone_blades_edge_mountains.cpp:435

Member Function Documentation

bool npc_simon_bunny::npc_simon_bunnyAI::CheckPlayer ( )
inline
851  {
853  {
854  if (player->isDead())
855  return false;
856  if (player->GetDistance2d(me) >= 2.0f*searchDistance)
857  {
858  GivePunishment();
859  return false;
860  }
861  }
862  else
863  return false;
864 
865  return true;
866  }
void GivePunishment()
Definition: zone_blades_edge_mountains.cpp:815
ObjectGuid playerGUID
Definition: zone_blades_edge_mountains.cpp:437
Creature *const me
Definition: CreatureAI.h:71
TC_GAME_API Player * GetPlayer(Map const *, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:184
float searchDistance
Definition: zone_blades_edge_mountains.cpp:440

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void npc_simon_bunny::npc_simon_bunnyAI::CheckPlayerSequence ( )
inline
661  {
662  bool correct = true;
663  if (playerSequence.size() <= colorSequence.size())
664  for (std::list<uint8>::const_iterator i = playerSequence.begin(), j = colorSequence.begin(); i != playerSequence.end(); ++i, ++j)
665  if ((*i) != (*j))
666  correct = false;
667 
668  if (correct && (playerSequence.size() == colorSequence.size()))
670  else if (!correct)
672  }
std::list< uint8 > playerSequence
Definition: zone_blades_edge_mountains.cpp:442
void DoAction(int32 action) override
Definition: zone_blades_edge_mountains.cpp:498
Definition: zone_blades_edge_mountains.cpp:400
std::list< uint8 > colorSequence
Definition: zone_blades_edge_mountains.cpp:442
Definition: zone_blades_edge_mountains.cpp:399

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void npc_simon_bunny::npc_simon_bunnyAI::DoAction ( int32  action)
inlineoverridevirtual

Reimplemented from UnitAI.

499  {
500  switch (action)
501  {
503  listening = false;
507  if (gameLevel == 10)
508  ResetNode();
509  else
511  break;
513  gameLevel++;
515  break;
517  GivePunishment();
519  break;
520  }
521  }
void GivePunishment()
Definition: zone_blades_edge_mountains.cpp:815
void CancelEventGroup(uint32 group)
Definition: EventMap.cpp:103
EventMap _events
Definition: zone_blades_edge_mountains.cpp:441
Definition: zone_blades_edge_mountains.cpp:391
bool listening
Definition: zone_blades_edge_mountains.cpp:433
void DoAction(int32 action) override
Definition: zone_blades_edge_mountains.cpp:498
Definition: zone_blades_edge_mountains.cpp:400
void DoCast(uint32 spellId)
Definition: UnitAI.cpp:101
void GiveRewardForLevel(uint8 level)
Definition: zone_blades_edge_mountains.cpp:784
uint8 gameLevel
Definition: zone_blades_edge_mountains.cpp:434
void ScheduleEvent(uint32 eventId, Milliseconds const &time, uint32 group=0, uint8 phase=0)
Definition: EventMap.h:123
void ResetNode()
Definition: zone_blades_edge_mountains.cpp:637
Definition: zone_blades_edge_mountains.cpp:380
Definition: zone_blades_edge_mountains.cpp:401
Definition: zone_blades_edge_mountains.cpp:399

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void npc_simon_bunny::npc_simon_bunnyAI::GenerateColorSequence ( )
inline
679  {
680  colorSequence.clear();
681  for (uint8 i = 0; i <= gameLevel; i++)
683 
684  for (std::list<uint8>::const_iterator i = colorSequence.begin(); i != colorSequence.end(); ++i)
685  playableSequence.push_back(*i);
686  }
std::list< uint8 > playableSequence
Definition: zone_blades_edge_mountains.cpp:442
Definition: zone_blades_edge_mountains.cpp:408
Definition: zone_blades_edge_mountains.cpp:409
static First const & RAND(First const &first, Second const &second, Rest const &...rest)
Definition: CreatureAIImpl.h:30
uint8 gameLevel
Definition: zone_blades_edge_mountains.cpp:434
Definition: zone_blades_edge_mountains.cpp:407
uint8_t uint8
Definition: Define.h:152
std::list< uint8 > colorSequence
Definition: zone_blades_edge_mountains.cpp:442
Definition: zone_blades_edge_mountains.cpp:406

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void npc_simon_bunny::npc_simon_bunnyAI::GivePunishment ( )
inline
816  {
817  if (large)
818  {
821  guardian->AI()->AttackStart(player);
822 
823  ResetNode();
824  }
825  else
826  {
827  fails++;
828 
830  DoCast(player, SPELL_BAD_PRESS_TRIGGER, true);
831 
832  if (fails >= 4)
833  ResetNode();
834  }
835  }
ObjectGuid playerGUID
Definition: zone_blades_edge_mountains.cpp:437
float zCoordCorrection
Definition: zone_blades_edge_mountains.cpp:439
Definition: Creature.h:467
Creature *const me
Definition: CreatureAI.h:71
Definition: zone_blades_edge_mountains.cpp:345
float GetPositionY() const
Definition: Position.h:105
TC_GAME_API Player * GetPlayer(Map const *, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:184
float GetPositionZ() const
Definition: Position.h:106
void DoCast(uint32 spellId)
Definition: UnitAI.cpp:101
bool large
Definition: zone_blades_edge_mountains.cpp:432
void ResetNode()
Definition: zone_blades_edge_mountains.cpp:637
float GetPositionX() const
Definition: Position.h:104
TempSummon * SummonCreature(uint32 id, Position const &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0) const
Definition: Object.cpp:2346
uint8 fails
Definition: zone_blades_edge_mountains.cpp:435
Definition: zone_blades_edge_mountains.cpp:382

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void npc_simon_bunny::npc_simon_bunnyAI::GiveRewardForLevel ( uint8  level)
inline
785  {
786  uint32 rewSpell = 0;
787  switch (level)
788  {
789  case 6:
790  if (large)
791  GivePunishment();
792  else
793  rewSpell = SPELL_REWARD_BUFF_1;
794  break;
795  case 8:
796  rewSpell = SPELL_REWARD_BUFF_2;
797  break;
798  case 10:
799  rewSpell = SPELL_REWARD_BUFF_3;
800  break;
801  }
802 
803  if (rewSpell)
805  DoCast(player, rewSpell, true);
806  }
void GivePunishment()
Definition: zone_blades_edge_mountains.cpp:815
ObjectGuid playerGUID
Definition: zone_blades_edge_mountains.cpp:437
Definition: zone_blades_edge_mountains.cpp:385
Definition: zone_blades_edge_mountains.cpp:386
Creature *const me
Definition: CreatureAI.h:71
Definition: zone_blades_edge_mountains.cpp:384
TC_GAME_API Player * GetPlayer(Map const *, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:184
uint32_t uint32
Definition: Define.h:150
void DoCast(uint32 spellId)
Definition: UnitAI.cpp:101
bool large
Definition: zone_blades_edge_mountains.cpp:432

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void npc_simon_bunny::npc_simon_bunnyAI::PlayColor ( uint8  color)
inline
716  {
717  switch (color)
718  {
719  case SIMON_BLUE:
722  break;
723  case SIMON_GREEN:
726  break;
727  case SIMON_RED:
730  break;
731  case SIMON_YELLOW:
734  break;
735  }
736  }
Definition: zone_blades_edge_mountains.cpp:408
Definition: zone_blades_edge_mountains.cpp:373
Definition: zone_blades_edge_mountains.cpp:409
Definition: zone_blades_edge_mountains.cpp:375
void DoPlaySoundToSet(WorldObject *source, uint32 soundId)
Definition: ScriptedCreature.cpp:163
Creature *const me
Definition: CreatureAI.h:71
Definition: zone_blades_edge_mountains.cpp:368
void DoCast(uint32 spellId)
Definition: UnitAI.cpp:101
Definition: zone_blades_edge_mountains.cpp:407
Definition: zone_blades_edge_mountains.cpp:374
Definition: zone_blades_edge_mountains.cpp:406
Definition: zone_blades_edge_mountains.cpp:370
Definition: zone_blades_edge_mountains.cpp:369
Definition: zone_blades_edge_mountains.cpp:367
Definition: zone_blades_edge_mountains.cpp:372

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void npc_simon_bunny::npc_simon_bunnyAI::PlayNextColor ( )
inline
709  {
710  PlayColor(*playableSequence.begin());
711  playableSequence.erase(playableSequence.begin());
712  }
void PlayColor(uint8 color)
Definition: zone_blades_edge_mountains.cpp:715
std::list< uint8 > playableSequence
Definition: zone_blades_edge_mountains.cpp:442

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void npc_simon_bunny::npc_simon_bunnyAI::PrepareClusters ( bool  clustersOnly = false)
inline
691  {
692  for (uint32 clusterId = SIMON_BLUE; clusterId < SIMON_MAX_COLORS; clusterId++)
693  if (GameObject* cluster = me->FindNearestGameObject(clusterIds[clusterId], searchDistance))
694  cluster->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
695 
696  if (clustersOnly)
697  return;
698 
699  for (uint32 auraId = GO_AURA_BLUE; auraId <= GO_AURA_YELLOW; auraId++)
700  if (GameObject* auraGo = me->FindNearestGameObject(auraId, searchDistance))
701  auraGo->RemoveFromWorld();
702  }
Definition: SharedDefines.h:2125
GameObject * FindNearestGameObject(uint32 entry, float range) const
Definition: Object.cpp:2452
Creature *const me
Definition: CreatureAI.h:71
Definition: zone_blades_edge_mountains.cpp:352
uint32 clusterIds[SIMON_MAX_COLORS]
Definition: zone_blades_edge_mountains.cpp:438
uint32_t uint32
Definition: Define.h:150
Definition: GameObject.h:880
float searchDistance
Definition: zone_blades_edge_mountains.cpp:440
Definition: UpdateFields.h:319
Definition: zone_blades_edge_mountains.cpp:349
Definition: zone_blades_edge_mountains.cpp:406
Definition: zone_blades_edge_mountains.cpp:410

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void npc_simon_bunny::npc_simon_bunnyAI::ResetNode ( )
inline
638  {
640 
641  for (uint32 clusterId = SIMON_BLUE; clusterId < SIMON_MAX_COLORS; clusterId++)
642  if (GameObject* cluster = me->FindNearestGameObject(clusterIds[clusterId], searchDistance))
643  cluster->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
644 
645  for (uint32 auraId = GO_AURA_BLUE; auraId <= GO_AURA_YELLOW; auraId++)
646  if (GameObject* auraGo = me->FindNearestGameObject(auraId, searchDistance))
647  auraGo->RemoveFromWorld();
648 
650  relic->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
651 
652  me->DespawnOrUnsummon(1000);
653  }
void DespawnOrUnsummon(uint32 msTimeToDespawn=0)
Definition: Creature.cpp:1774
Definition: SharedDefines.h:2125
GameObject * FindNearestGameObject(uint32 entry, float range) const
Definition: Object.cpp:2452
Definition: zone_blades_edge_mountains.cpp:347
void DoPlaySoundToSet(WorldObject *source, uint32 soundId)
Definition: ScriptedCreature.cpp:163
Creature *const me
Definition: CreatureAI.h:71
Definition: zone_blades_edge_mountains.cpp:352
uint32 clusterIds[SIMON_MAX_COLORS]
Definition: zone_blades_edge_mountains.cpp:438
uint32_t uint32
Definition: Define.h:150
Definition: GameObject.h:880
float searchDistance
Definition: zone_blades_edge_mountains.cpp:440
Definition: UpdateFields.h:319
bool large
Definition: zone_blades_edge_mountains.cpp:432
Definition: zone_blades_edge_mountains.cpp:349
Definition: zone_blades_edge_mountains.cpp:348
Definition: zone_blades_edge_mountains.cpp:406
Definition: zone_blades_edge_mountains.cpp:376
Definition: zone_blades_edge_mountains.cpp:410

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void npc_simon_bunny::npc_simon_bunnyAI::SetData ( uint32  type,
uint32   
)
inlineoverridevirtual

Reimplemented from UnitAI.

525  {
526  if (!listening)
527  return;
528 
529  uint8 pressedColor = SIMON_MAX_COLORS;
530 
531  if (type == clusterIds[SIMON_RED])
532  pressedColor = SIMON_RED;
533  else if (type == clusterIds[SIMON_BLUE])
534  pressedColor = SIMON_BLUE;
535  else if (type == clusterIds[SIMON_GREEN])
536  pressedColor = SIMON_GREEN;
537  else if (type == clusterIds[SIMON_YELLOW])
538  pressedColor = SIMON_YELLOW;
539 
540  PlayColor(pressedColor);
541  playerSequence.push_back(pressedColor);
544  }
void PlayColor(uint8 color)
Definition: zone_blades_edge_mountains.cpp:715
Definition: zone_blades_edge_mountains.cpp:408
Definition: zone_blades_edge_mountains.cpp:393
EventMap _events
Definition: zone_blades_edge_mountains.cpp:441
Definition: zone_blades_edge_mountains.cpp:409
std::list< uint8 > playerSequence
Definition: zone_blades_edge_mountains.cpp:442
bool listening
Definition: zone_blades_edge_mountains.cpp:433
uint32 clusterIds[SIMON_MAX_COLORS]
Definition: zone_blades_edge_mountains.cpp:438
void ScheduleEvent(uint32 eventId, Milliseconds const &time, uint32 group=0, uint8 phase=0)
Definition: EventMap.h:123
void CheckPlayerSequence()
Definition: zone_blades_edge_mountains.cpp:660
Definition: zone_blades_edge_mountains.cpp:407
uint8_t uint8
Definition: Define.h:152
Definition: zone_blades_edge_mountains.cpp:406
Definition: zone_blades_edge_mountains.cpp:410

+ Here is the call graph for this function:

void npc_simon_bunny::npc_simon_bunnyAI::SetGUID ( ObjectGuid  guid,
int32  id 
)
inlineoverridevirtual

Reimplemented from UnitAI.

548  {
549  me->SetCanFly(true);
550 
551  large = id != 0;
552  playerGUID = guid;
553  StartGame();
554  }
ObjectGuid playerGUID
Definition: zone_blades_edge_mountains.cpp:437
void StartGame()
Definition: zone_blades_edge_mountains.cpp:560
Creature *const me
Definition: CreatureAI.h:71
bool SetCanFly(bool enable)
Definition: Unit.cpp:15899
bool large
Definition: zone_blades_edge_mountains.cpp:432

+ Here is the call graph for this function:

void npc_simon_bunny::npc_simon_bunnyAI::SetUpPreGame ( )
inline
743  {
744  for (uint32 clusterId = SIMON_BLUE; clusterId < SIMON_MAX_COLORS; clusterId++)
745  {
746  if (GameObject* cluster = me->FindNearestGameObject(clusterIds[clusterId], 2.0f*searchDistance))
747  {
748  cluster->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
749 
750  // break since we don't need glowing auras for large clusters
751  if (large)
752  break;
753 
754  float x, y, z, o;
755  cluster->GetPosition(x, y, z, o);
756  me->NearTeleportTo(x, y, z, o);
757 
758  uint32 preGameSpellId;
759  if (cluster->GetEntry() == clusterIds[SIMON_RED])
760  preGameSpellId = SPELL_PRE_GAME_RED;
761  else if (cluster->GetEntry() == clusterIds[SIMON_BLUE])
762  preGameSpellId = SPELL_PRE_GAME_BLUE;
763  else if (cluster->GetEntry() == clusterIds[SIMON_GREEN])
764  preGameSpellId = SPELL_PRE_GAME_GREEN;
765  else if (cluster->GetEntry() == clusterIds[SIMON_YELLOW])
766  preGameSpellId = SPELL_PRE_GAME_YELLOW;
767  else break;
768 
769  me->CastSpell(cluster, preGameSpellId, true);
770  }
771  }
772 
774  {
775  float x, y, z, o;
776  relic->GetPosition(x, y, z, o);
777  me->NearTeleportTo(x, y, z + zCoordCorrection, o);
778  }
779 
781  }
Definition: SharedDefines.h:2125
Definition: zone_blades_edge_mountains.cpp:408
GameObject * FindNearestGameObject(uint32 entry, float range) const
Definition: Object.cpp:2452
Definition: zone_blades_edge_mountains.cpp:347
float zCoordCorrection
Definition: zone_blades_edge_mountains.cpp:439
Definition: zone_blades_edge_mountains.cpp:409
Definition: zone_blades_edge_mountains.cpp:364
Creature *const me
Definition: CreatureAI.h:71
Definition: zone_blades_edge_mountains.cpp:365
void NearTeleportTo(float x, float y, float z, float orientation, bool casting=false)
Definition: Unit.cpp:15407
uint32 clusterIds[SIMON_MAX_COLORS]
Definition: zone_blades_edge_mountains.cpp:438
G3D::int16 z
Definition: Vector3int16.h:46
uint32_t uint32
Definition: Define.h:150
G3D::int16 y
Definition: Vector2int16.h:38
Definition: GameObject.h:880
float searchDistance
Definition: zone_blades_edge_mountains.cpp:440
Definition: UpdateFields.h:319
Definition: zone_blades_edge_mountains.cpp:407
Definition: zone_blades_edge_mountains.cpp:363
bool large
Definition: zone_blades_edge_mountains.cpp:432
void GenerateColorSequence()
Definition: zone_blades_edge_mountains.cpp:678
Definition: zone_blades_edge_mountains.cpp:348
Definition: zone_blades_edge_mountains.cpp:406
G3D::int16 x
Definition: Vector2int16.h:37
Definition: zone_blades_edge_mountains.cpp:366
void CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=NULL, AuraEffect const *triggeredByAura=NULL, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:869
Definition: zone_blades_edge_mountains.cpp:410

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void npc_simon_bunny::npc_simon_bunnyAI::SpellHitTarget ( Unit target,
const SpellInfo spell 
)
inlineoverridevirtual

Reimplemented from ScriptedAI.

838  {
839  // Cast SPELL_BAD_PRESS_DAMAGE with scaled basepoints when the visual hits the target.
840  // Need Fix: When SPELL_BAD_PRESS_TRIGGER hits target it triggers spell SPELL_BAD_PRESS_DAMAGE by itself
841  // so player gets damage equal to calculated damage dbc basepoints for SPELL_BAD_PRESS_DAMAGE (~50)
842  if (spell->Id == SPELL_BAD_PRESS_TRIGGER)
843  {
844  int32 bp = (int32)((float)(fails)*0.33f*target->GetMaxHealth());
845  target->CastCustomSpell(target, SPELL_BAD_PRESS_DAMAGE, &bp, NULL, NULL, true);
846  }
847  }
Definition: zone_blades_edge_mountains.cpp:383
uint32 Id
Definition: SpellInfo.h:329
uint32 GetMaxHealth() const
Definition: Unit.h:1427
arena_t NULL
Definition: jemalloc_internal.h:624
int32_t int32
Definition: Define.h:146
int32_t int32
Definition: g3dmath.h:167
void CastCustomSpell(Unit *victim, uint32 spellId, int32 const *bp0, int32 const *bp1, int32 const *bp2, bool triggered, Item *castItem=NULL, AuraEffect const *triggeredByAura=NULL, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:920
uint8 fails
Definition: zone_blades_edge_mountains.cpp:435
Definition: zone_blades_edge_mountains.cpp:382

+ Here is the call graph for this function:

void npc_simon_bunny::npc_simon_bunnyAI::StartGame ( )
inline
561  {
562  listening = false;
563  gameLevel = 0;
564  fails = 0;
565  gameTicks = 0;
566  zCoordCorrection = large ? 8.0f : 2.75f;
567  searchDistance = large ? 13.0f : 5.0f;
568  colorSequence.clear();
569  playableSequence.clear();
570  playerSequence.clear();
571  me->SetObjectScale(large ? 2.0f : 1.0f);
572 
573  std::list<WorldObject*> ClusterList;
576  me->VisitNearbyObject(searchDistance, searcher);
577 
578  for (std::list<WorldObject*>::const_iterator i = ClusterList.begin(); i != ClusterList.end(); ++i)
579  {
580  if (GameObject* go = (*i)->ToGameObject())
581  {
582  // We are checking for displayid because all simon nodes have 4 clusters with different entries
583  if (large)
584  {
585  switch (go->GetGOInfo()->displayId)
586  {
588  clusterIds[SIMON_BLUE] = go->GetEntry();
589  break;
590 
592  clusterIds[SIMON_RED] = go->GetEntry();
593  break;
594 
596  clusterIds[SIMON_GREEN] = go->GetEntry();
597  break;
598 
600  clusterIds[SIMON_YELLOW] = go->GetEntry();
601  break;
602  }
603  }
604  else
605  {
606  switch (go->GetGOInfo()->displayId)
607  {
609  clusterIds[SIMON_BLUE] = go->GetEntry();
610  break;
611 
613  clusterIds[SIMON_RED] = go->GetEntry();
614  break;
615 
617  clusterIds[SIMON_GREEN] = go->GetEntry();
618  break;
619 
621  clusterIds[SIMON_YELLOW] = go->GetEntry();
622  break;
623  }
624  }
625  }
626  }
627 
628  _events.Reset();
631 
633  relic->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
634  }
uint8 gameTicks
Definition: zone_blades_edge_mountains.cpp:436
Definition: zone_blades_edge_mountains.cpp:356
Definition: SharedDefines.h:2125
std::list< uint8 > playableSequence
Definition: zone_blades_edge_mountains.cpp:442
void Reset()
Definition: EventMap.cpp:20
Definition: zone_blades_edge_mountains.cpp:408
GameObject * FindNearestGameObject(uint32 entry, float range) const
Definition: Object.cpp:2452
Definition: zone_blades_edge_mountains.cpp:347
float zCoordCorrection
Definition: zone_blades_edge_mountains.cpp:439
Definition: zone_blades_edge_mountains.cpp:359
EventMap _events
Definition: zone_blades_edge_mountains.cpp:441
Definition: zone_blades_edge_mountains.cpp:409
void SetObjectScale(float scale) override
Definition: Creature.cpp:2653
GameObject * ToGameObject()
Definition: Object.h:200
Definition: zone_blades_edge_mountains.cpp:397
void VisitNearbyObject(float const &radius, NOTIFIER &notifier) const
Definition: Object.h:587
std::list< uint8 > playerSequence
Definition: zone_blades_edge_mountains.cpp:442
bool listening
Definition: zone_blades_edge_mountains.cpp:433
Creature *const me
Definition: CreatureAI.h:71
Definition: zone_blades_edge_mountains.cpp:357
uint32 clusterIds[SIMON_MAX_COLORS]
Definition: zone_blades_edge_mountains.cpp:438
Definition: zone_blades_edge_mountains.cpp:394
Definition: zone_blades_edge_mountains.cpp:360
Definition: GameObject.h:880
float searchDistance
Definition: zone_blades_edge_mountains.cpp:440
uint8 gameLevel
Definition: zone_blades_edge_mountains.cpp:434
void ScheduleEvent(uint32 eventId, Milliseconds const &time, uint32 group=0, uint8 phase=0)
Definition: EventMap.h:123
Definition: UpdateFields.h:319
Definition: zone_blades_edge_mountains.cpp:354
Definition: zone_blades_edge_mountains.cpp:407
bool large
Definition: zone_blades_edge_mountains.cpp:432
Definition: zone_blades_edge_mountains.cpp:361
Definition: zone_blades_edge_mountains.cpp:358
Definition: zone_blades_edge_mountains.cpp:348
std::list< uint8 > colorSequence
Definition: zone_blades_edge_mountains.cpp:442
Definition: zone_blades_edge_mountains.cpp:406
Definition: GridNotifiers.h:218
Definition: zone_blades_edge_mountains.cpp:355
Definition: GridNotifiers.h:1317
uint8 fails
Definition: zone_blades_edge_mountains.cpp:435

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void npc_simon_bunny::npc_simon_bunnyAI::UpdateAI ( uint32  diff)
inlineoverridevirtual

Reimplemented from ScriptedAI.

445  {
446  _events.Update(diff);
447 
448  switch (_events.ExecuteEvent())
449  {
451  if (!CheckPlayer())
452  ResetNode();
453  else
455  break;
457  SetUpPreGame();
460  break;
462  if (!playableSequence.empty())
463  {
464  PlayNextColor();
466  }
467  else
468  {
469  listening = true;
471  playerSequence.clear();
472  PrepareClusters();
473  gameTicks = 0;
475  }
476  break;
479 
480  if (gameTicks > gameLevel)
482  else
484  gameTicks++;
485  break;
487  PrepareClusters(true);
488  break;
491  break;
494  break;
495  }
496  }
void PrepareClusters(bool clustersOnly=false)
Definition: zone_blades_edge_mountains.cpp:690
uint8 gameTicks
Definition: zone_blades_edge_mountains.cpp:436
std::list< uint8 > playableSequence
Definition: zone_blades_edge_mountains.cpp:442
Definition: zone_blades_edge_mountains.cpp:392
Definition: zone_blades_edge_mountains.cpp:393
void PlayNextColor()
Definition: zone_blades_edge_mountains.cpp:708
void CancelEvent(uint32 eventId)
Definition: EventMap.cpp:89
EventMap _events
Definition: zone_blades_edge_mountains.cpp:441
Definition: zone_blades_edge_mountains.cpp:396
Definition: zone_blades_edge_mountains.cpp:391
Definition: zone_blades_edge_mountains.cpp:397
std::list< uint8 > playerSequence
Definition: zone_blades_edge_mountains.cpp:442
Definition: zone_blades_edge_mountains.cpp:378
bool listening
Definition: zone_blades_edge_mountains.cpp:433
void DoAction(int32 action) override
Definition: zone_blades_edge_mountains.cpp:498
Definition: zone_blades_edge_mountains.cpp:400
Definition: zone_blades_edge_mountains.cpp:394
void DoCast(uint32 spellId)
Definition: UnitAI.cpp:101
uint8 gameLevel
Definition: zone_blades_edge_mountains.cpp:434
void ScheduleEvent(uint32 eventId, Milliseconds const &time, uint32 group=0, uint8 phase=0)
Definition: EventMap.h:123
void Update(uint32 time)
Definition: EventMap.h:54
bool CheckPlayer()
Definition: zone_blades_edge_mountains.cpp:850
Definition: zone_blades_edge_mountains.cpp:379
uint32 ExecuteEvent()
Definition: EventMap.cpp:46
void ResetNode()
Definition: zone_blades_edge_mountains.cpp:637
Definition: zone_blades_edge_mountains.cpp:401
Definition: zone_blades_edge_mountains.cpp:395
void SetUpPreGame()
Definition: zone_blades_edge_mountains.cpp:742

+ Here is the call graph for this function:

Member Data Documentation

EventMap npc_simon_bunny::npc_simon_bunnyAI::_events
uint32 npc_simon_bunny::npc_simon_bunnyAI::clusterIds[SIMON_MAX_COLORS]
std::list<uint8> npc_simon_bunny::npc_simon_bunnyAI::colorSequence
uint8 npc_simon_bunny::npc_simon_bunnyAI::fails
uint8 npc_simon_bunny::npc_simon_bunnyAI::gameLevel
uint8 npc_simon_bunny::npc_simon_bunnyAI::gameTicks
bool npc_simon_bunny::npc_simon_bunnyAI::large
bool npc_simon_bunny::npc_simon_bunnyAI::listening
std::list<uint8> npc_simon_bunny::npc_simon_bunnyAI::playableSequence
ObjectGuid npc_simon_bunny::npc_simon_bunnyAI::playerGUID
std::list<uint8> npc_simon_bunny::npc_simon_bunnyAI::playerSequence
float npc_simon_bunny::npc_simon_bunnyAI::searchDistance
float npc_simon_bunny::npc_simon_bunnyAI::zCoordCorrection

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