163 if (player->GetZoneId() ==
ZONE_DALARAN && !player->IsFlying() && !player->IsMounted() && !player->IsGameMaster())
164 playerList.push_back(player);
169 if (PlayerInDalaranList.empty())
193 std::vector<Player*> PlayerInDalaranList;
197 if (PlayerInDalaranList.empty() ||
urand(1, 100) > PlayerInDalaranList.size())
206 float dist =
frand(10.0f, 30.0f);
207 float angle =
frand(0.0f, 1.0f) *
M_PI * 2.0f;
208 player->MovePositionToFirstCollision(pos, dist, angle);
SQLTransaction< CharacterDatabaseConnection > CharacterDatabaseTransaction
DatabaseWorkerPool< CharacterDatabaseConnection > CharacterDatabase
Accessor to the character database.
std::chrono::seconds Seconds
Seconds shorthand typedef.
float frand(float min, float max)
int32 irand(int32 min, int32 max)
uint32 urand(uint32 min, uint32 max)
#define RegisterCreatureAI(ai_name)
#define RegisterSpellScript(spell_script)
Creature * GetClosestCreatureWithEntry(WorldObject *source, uint32 entry, float maxSearchRange, bool alive=true)
@ SPELL_EFFECT_SCRIPT_EFFECT
@ EMOTE_ONESHOT_LAUGH_NO_SHEATHE
#define SpellEffectFn(F, I, N)
void ScheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
void SendMailTo(CharacterDatabaseTransaction trans, MailReceiver const &receiver, MailSender const &sender, MailCheckMask checked=MAIL_CHECK_MASK_NONE, uint32 deliver_delay=0)
Player * GetPlayer(ObjectGuid const &guid)
PlayerList const & GetPlayers() const
void MoveRandom(float wanderDistance=0.0f)
static Player * ToPlayer(Object *o)
bool IsGameMaster() const
bool IsBeingTeleported() const
Unit * GetHitUnit() const
HookList< EffectHandler > OnEffectHitTarget
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
SpellCastResult DoCast(uint32 spellId)
bool isInBackInMap(Unit const *target, float distance, float arc=float(M_PI)) const
MotionMaster * GetMotionMaster()
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
void NearTeleportTo(Position const &pos, bool casting=false)
void HandleEmoteCommand(Emote emoteId)
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
void setActive(bool isActiveObject)
void AddObjectToRemoveList()
Player * GetCharmerOrOwnerPlayerOrPlayerItself() const
bool IsWithinDist(WorldObject const *obj, float dist2compare, bool is3D=true) const
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
PrepareSpellScript(spell_dalaran_teleport_to_dalaran)
bool Validate(SpellInfo const *) override
void HandleScript(SpellEffIndex)
bool Validate(SpellInfo const *) override
void HandleScript(SpellEffIndex)
PrepareSpellScript(spell_dalaran_teleport_to_lake_wintergrasp)
auto SelectRandomContainerElement(C const &container) -> typename std::add_const< decltype(*std::begin(container))>::type &
float GetPositionZ() const
float GetOrientation() const
float GetPositionX() const
void GetPosition(float &x, float &y) const
float GetPositionY() const
npc_mageguard_dalaran(Creature *creature)
void JustEngagedWith(Unit *) override
void UpdateAI(uint32) override
void AttackStart(Unit *) override
void MoveInLineOfSight(Unit *who) override
void SendMailToPlayer(Player *player) const
static Player * SelectTargetInDalaran(std::vector< Player * > &PlayerInDalaranList)
void GetPlayersInDalaran(std::vector< Player * > &playerList) const
npc_minigob_manabonk(Creature *creature)
void UpdateAI(uint32 diff) override
@ SPELL_SUNREAVER_DISGUISE_MALE
@ SPELL_SILVER_COVENANT_DISGUISE_FEMALE
@ SPELL_SILVER_COVENANT_DISGUISE_MALE
@ SPELL_SUNREAVER_DISGUISE_FEMALE
@ NPC_SILVER_COVENANT_GUARDIAN_MAGE
@ NPC_SUNREAVER_GUARDIAN_MAGE
@ SPELL_TELEPORT_TO_DALARAN
TeleportToLakeWintergrasp
@ SPELL_TELEPORT_TO_LAKE_WINTERGRASP