AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
Random.cpp File Reference
#include "Random.h"
#include "Errors.h"
#include "SFMTRand.h"
#include <memory>
#include <random>

Go to the source code of this file.

Functions

static SFMTRandGetRng ()
 
int32 irand (int32 min, int32 max)
 
uint32 urand (uint32 min, uint32 max)
 
uint32 urandms (uint32 min, uint32 max)
 
float frand (float min, float max)
 
Milliseconds randtime (Milliseconds min, Milliseconds max)
 
uint32 rand32 ()
 
double rand_norm ()
 
double rand_chance ()
 
uint32 urandweighted (std::size_t count, double const *chances)
 

Variables

static thread_local std::unique_ptr< SFMTRandsfmtRand
 
static RandomEngine engine
 

Function Documentation

◆ frand()

float frand ( float  min,
float  max 
)
58{
59 ASSERT(max >= min);
60 std::uniform_real_distribution<float> urd(min, max);
61 return urd(engine);
62}
#define ASSERT
Definition: Errors.h:68
static RandomEngine engine
Definition: Random.cpp:25

References ASSERT, and engine.

Referenced by npc_pos_martin_or_gorkun_second::npc_pos_martin_or_gorkun_secondAI::DoAction(), npc_time_rift::DoSummonAtRift(), Unit::GetMeleeAttackPoint(), FleeingMovementGenerator< T >::GetPoint(), npc_valkyr_shadowguard::npc_valkyr_shadowguardAI::GoSiphon(), go_tadpole_cage::go_tadpole_cageAI::GossipHello(), spell_item_unusual_compass::HandleDummy(), spell_entropius_black_hole_effect::HandlePull(), spell_boss_magus_telestra_gravity_well::HandlePull(), npc_eris_hevenfire::npc_eris_hevenfireAI::JustSummoned(), spell_gen_random_target32::ModDest(), spell_q12308_escape_from_silverbrook_summon_worgen::ModDest(), spell_random_lightning_visual_effect::ModDestHeight(), npc_gunship_boarding_addAI::MovementInform(), SmartScript::ProcessAction(), npc_lake_frog::npc_lake_frogAI::ReceiveEmote(), npc_firework::npc_fireworkAI::Reset(), PassengerController::SelectSpawnPoint(), spell_mother_shahraz_fatal_attraction::SetDest(), spell_q10898_skywing::SetDest(), npc_icc_gauntlet_controller::npc_icc_gauntlet_controllerAI::SummonBroodling(), npc_eris_hevenfire::npc_eris_hevenfireAI::SummonPeasants(), spell_midsummer_fling_torch::ThrowNextTorch(), instance_old_hillsbrad::instance_old_hillsbrad_InstanceMapScript::Update(), npc_scarlet_ghoul::npc_scarlet_ghoulAI::UpdateAI(), boss_arlokk::boss_arlokkAI::UpdateAI(), npc_pos_leader::npc_pos_leaderAI::UpdateAI(), npc_pos_martin_or_gorkun_second::npc_pos_martin_or_gorkun_secondAI::UpdateAI(), and npc_tirions_gambit_tirion::npc_tirions_gambit_tirionAI::UpdateEscortAI().

◆ GetRng()

static SFMTRand * GetRng ( )
static
28{
29 if (!sfmtRand)
30 {
31 sfmtRand = std::make_unique<SFMTRand>();
32 }
33
34 return sfmtRand.get();
35}
static thread_local std::unique_ptr< SFMTRand > sfmtRand
Definition: Random.cpp:24

References sfmtRand.

Referenced by rand32().

◆ irand()

int32 irand ( int32  min,
int32  max 
)
38{
39 ASSERT(max >= min);
40 std::uniform_int_distribution<int32> uid(min, max);
41 return uid(engine);
42}

References ASSERT, and engine.

Referenced by spell_shadowfang_keep_haunting_spirits_aura::CalcPeriodic(), SpellEffectInfo::CalcValue(), Spell::CheckCast(), Spell::EffectSchoolDMG(), Spell::EffectTeleportUnits(), GetItemEnchantMod(), spell_gen_gadgetzan_transporter_backfire::HandleDummy(), spell_item_flask_of_the_north::HandleDummy(), Unit::HandleDummyAuraProc(), npc_echo_of_medivh::HandlePieceMoveByAI(), spell_winter_veil_racer_slam_hit::HandleScriptEffect(), spell_dk_bloodworms::HandleSummon(), boss_kologarn_arms::boss_kologarn_armsAI::JustDied(), Unit::MagicSpellHitResult(), spell_gen_flurry_of_claws::OnPeriodic(), npc_doomfire_spirit::Reset(), roll_chance_i(), npc_minigob_manabonk::SendMailToPlayer(), boss_janalai::SpawnBombs(), npc_xt002_heart::npc_xt002_heartAI::SpellHitTarget(), boss_general_angerforge::boss_general_angerforgeAI::SummonAdds(), boss_akilzon::SummonEagles(), boss_general_angerforge::boss_general_angerforgeAI::SummonMedics(), Spell::TakePower(), npc_scarlet_cannon::npc_scarlet_cannonAI::UpdateAI(), npc_akilzon_eagle::UpdateAI(), npc_murkdeep::npc_murkdeepAI::UpdateAI(), npc_pos_after_first_boss::npc_pos_after_first_bossAI::UpdateAI(), boss_grobbulus::boss_grobbulusAI::UpdateAI(), boss_thorim_sif::boss_thorim_sifAI::UpdateAI(), violet_hold_trashAI::UpdateAI(), npc_llod_generic::npc_llod_genericAI::UpdateAI(), Player::UpdateSkillPro(), and GameObject::Use().

◆ rand32()

◆ rand_chance()

double rand_chance ( )

◆ rand_norm()

double rand_norm ( )
78{
79 std::uniform_real_distribution<double> urd;
80 return urd(engine);
81}

References engine.

Referenced by RandomMovementGenerator< T >::_setRandomLocation(), Unit::CalcAbsorbResist(), SpellImplicitTargetInfo::CalcDirectionAngle(), boss_headless_horseman::DamageTaken(), npc_midsummer_ribbon_pole_target::DoDancingFLameChecks(), RandomMovementGenerator< T >::DoInitialize(), ConfusedMovementGenerator< T >::DoInitialize(), npc_time_rift::DoSummonAtRift(), Spell::EffectStuck(), Spell::EffectTransmitted(), violet_hold_trashAI::EnterEvadeMode(), Unit::GetRandomContactPoint(), WorldObject::GetRandomNearPosition(), WorldObject::GetRandomPoint(), Position::GetSinCos(), npc_valkyr_shadowguard::npc_valkyr_shadowguardAI::GoSiphon(), spell_icc_geist_alarm::HandleEvent(), WorldSession::HandlePetActionHelper(), spell_dreamwalker_summon_portal::HandleScript(), boss_onyxia::HandleWhelpSpam(), spell_q11065_wrangle_some_aether_rays_aura::if(), npc_troll_volunteer::npc_troll_volunteerAI::InitializeAI(), npc_hourglass_of_eternity::npc_hourglass_of_eternityAI::InitializeAI(), npc_pet_dk_army_of_the_dead::npc_pet_dk_army_of_the_deadAI::InitializeAI(), boss_keleseth::JustEngagedWith(), boss_high_astromancer_solarian::JustEngagedWith(), boss_auriaya::boss_auriayaAI::JustSummoned(), spell_the_lich_king_teleport_to_frostmourne_hc::ModDest(), npc_ulduar_snow_mound::MoveInLineOfSight(), npc_concentrated_ball::npc_concentrated_ballAI::MoveToNextPoint(), npc_mechanolift::npc_mechanoliftAI::npc_mechanoliftAI(), Unit::PetSpellFail(), npc_oculus_unstable_sphere::npc_oculus_unstable_sphereAI::PickNewLocation(), Weather::ReGenerate(), boss_anubarak_trial::boss_anubarak_trialAI::Reset(), boss_bjarngrim::boss_bjarngrimAI::Reset(), spell_sindragosa_s_fury::SelectDest(), Spell::SelectImplicitCasterDestTargets(), Spell::SelectImplicitDestDestTargets(), Spell::SelectImplicitTargetDestTargets(), spell_mother_shahraz_fatal_attraction::SetDest(), boss_yoggsaron_sara::boss_yoggsaron_saraAI::SpawnTentacle(), npc_pos_leader_second::npc_pos_leader_secondAI::SpellHitTarget(), npc_icc_gauntlet_controller::npc_icc_gauntlet_controllerAI::SummonBroodling(), boss_yoggsaron_sara::boss_yoggsaron_saraAI::SummonDeathOrbs(), boss_yoggsaron::boss_yoggsaronAI::SummonImmortalGuardian(), instance_old_hillsbrad::instance_old_hillsbrad_InstanceMapScript::Update(), instance_trial_of_the_champion::instance_trial_of_the_champion_InstanceMapScript::Update(), npc_dark_iron_attack_generator::UpdateAI(), npc_time_rift::UpdateAI(), boss_onyxia::UpdateAI(), boss_icehowl::boss_icehowlAI::UpdateAI(), boss_twin_valkyrAI::UpdateAI(), npc_pos_leader::npc_pos_leaderAI::UpdateAI(), boss_sindragosa::boss_sindragosaAI::UpdateAI(), npc_strangulate_vehicle::npc_strangulate_vehicleAI::UpdateAI(), boss_malygos::boss_malygosAI::UpdateAI(), boss_ormorok::UpdateAI(), boss_drakos::boss_drakosAI::UpdateAI(), boss_eregos::boss_eregosAI::UpdateAI(), boss_mimiron::boss_mimironAI::UpdateAI(), npc_ulduar_flames_initial::npc_ulduar_flames_initialAI::UpdateAI(), npc_ulduar_expedition_engineer::npc_ulduar_expedition_engineerAI::UpdateAI(), boss_ymiron::boss_ymironAI::UpdateAI(), npc_hourglass_of_eternity::npc_hourglass_of_eternityAI::UpdateAI(), and boss_ichoron::boss_ichoronAI::UpdateAI().

◆ randtime()

Milliseconds randtime ( Milliseconds  min,
Milliseconds  max 
)
65{
66 long long diff = max.count() - min.count();
67 ASSERT(diff >= 0);
68 ASSERT(diff <= (uint32) - 1);
69 return min + Milliseconds(urand(0, diff));
70}
std::chrono::milliseconds Milliseconds
Milliseconds shorthand typedef.
Definition: Duration.h:27
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:44
std::uint32_t uint32
Definition: Define.h:107

References ASSERT, and urand().

Referenced by EventProcessor::AddEventAtOffset(), boss_hungarfen::JustEngagedWith(), EventMap::Repeat(), EventMap::RescheduleEvent(), and EventMap::ScheduleEvent().

◆ urand()

uint32 urand ( uint32  min,
uint32  max 
)
45{
46 ASSERT(max >= min);
47 std::uniform_int_distribution<uint32> uid(min, max);
48 return uid(engine);
49}

References ASSERT, and engine.

Referenced by RandomMovementGenerator< T >::_setRandomLocation(), ObjectMgr::AddCreData(), Loot::AddItem(), instance_halls_of_reflection::instance_halls_of_reflection_InstanceMapScript::AddWave1(), spell_dk_ghoul_thrash::CalcDamage(), spell_allergies::CalcPeriodic(), spell_item_goblin_gumbo_kettle::CalcPeriodic(), spell_gen_consumption::CalculateDamage(), Unit::CalculateDamage(), boss_moira_bronzebeardAI::CastOnEmperorIfPossible(), BattlegroundAV::ChangeMineOwner(), boss_professor_putricide::boss_professor_putricideAI::ChangePhase(), lfg::LFGQueue::CheckCompatibility(), Group::CountTheRoll(), GameObject::Create(), boss_illidan_stormrage::CycleBeamPos(), npc_anubisath_defender::DamageTaken(), npc_infra_green_bomber_generic::npc_infra_green_bomber_genericAI::DamageTaken(), Unit::DealDamage(), boss_razorgore::boss_razorgoreAI::DoAction(), boss_anetheron::DoAction(), boss_rage_winterchill::DoAction(), npc_hyjal_ground_trash::DoAction(), npc_hyjal_gargoyle::DoAction(), npc_pos_martin_or_gorkun_second::npc_pos_martin_or_gorkun_secondAI::DoAction(), npc_chesspiece::DoAction(), boss_maexxna::boss_maexxnaAI::DoCastWebWrap(), npc_midsummer_ribbon_pole_target::DoFlameCircleChecks(), RandomMovementGenerator< T >::DoInitialize(), ConfusedMovementGenerator< T >::DoInitialize(), Player::DoRandomRoll(), npc_time_rift::DoSelectSummon(), instance_stratholme::instance_stratholme_InstanceMapScript::DoSpawnPlaguedCritters(), boss_skeram::DoTeleport(), ConfusedMovementGenerator< T >::DoUpdate(), Spell::EffectDispel(), Spell::EffectDummy(), Spell::EffectForceDeselect(), Spell::EffectScriptEffect(), Spell::EffectStealBeneficialBuff(), Spell::EffectTeleportUnits(), Spell::EffectTransmitted(), npc_ravenclaw_apparition::npc_ravenclaw_apparitionAI::EmoteCrowd(), boss_baron_geddon::boss_baron_geddonAI::ExecuteEvent(), boss_gehennas::boss_gehennasAI::ExecuteEvent(), boss_magmadar::boss_magmadarAI::ExecuteEvent(), boss_shazzrah::boss_shazzrahAI::ExecuteEvent(), boss_sulfuron::boss_sulfuronAI::ExecuteEvent(), boss_sartharion_tenebron::boss_sartharion_tenebronAI::ExecuteEvent(), boss_sartharion_shadron::boss_sartharion_shadronAI::ExecuteEvent(), boss_sartharion_vesperon::boss_sartharion_vesperonAI::ExecuteEvent(), emerald_dragonAI::ExecuteEvent(), boss_ysondre::boss_ysondreAI::ExecuteEvent(), boss_taerar::boss_taerarAI::ExecuteEvent(), spell_blade_dance_targeting::FilterTargets(), spell_deathbringer_blood_nova_targeting::FilterTargetsInitial(), spell_ulduar_stone_grip_cast_target::FilterTargetsInitial(), npc_dark_iron_guzzler::FindNextKeg(), boss_darkmaster_gandling::boss_darkmaster_gandlingAI::FindRoom(), Loot::generateMoneyLoot(), ObjectMgr::GeneratePetName(), ObjectMgr::GeneratePetNameLocale(), ObjectMgr::GetCreatureModelRandomGender(), ObjectMgr::GetEquipmentInfo(), npc_firework::npc_fireworkAI::GetFireworkGameObjectId(), Unit::GetMeleeAttackPoint(), Player::GetNextRandomRaidMember(), Unit::GetNextRandomRaidMemberOrPet(), npc_dark_iron_attack_generator::GetRandomBartender(), Creature::GetRandomId(), npc_brewfest_bark_trigger::GetTextFor(), boss_ambassador_flamelash::boss_ambassador_flamelashAI::getValidRandomPosition(), go_ossirian_crystal::go_ossirian_crystalAI::GossipHello(), go_tadpole_cage::go_tadpole_cageAI::GossipHello(), spell_brewfest_fill_keg::HandleAfterHit(), spell_gen_baby_murloc_passive::HandleApply(), AuraEffect::HandleAuraModShapeshift(), AuraEffect::HandleAuraTransform(), npc_echo_of_medivh::HandleCheat(), Player::HandleDrowning(), spell_fight_fire_bomber::HandleDummy(), spell_gen_focused_bursts::HandleDummy(), spell_hallows_end_candy::HandleDummy(), spell_q12589_shoot_rjr::HandleDummy(), spell_item_gnomish_universal_remote::HandleDummy(), spell_item_gnomish_shrink_ray::HandleDummy(), spell_item_make_a_wish::HandleDummy(), spell_item_net_o_matic::HandleDummy(), spell_item_noggenfogger_elixir::HandleDummy(), spell_item_savory_deviate_delight::HandleDummy(), spell_item_six_demon_bag::HandleDummy(), spell_item_underbelly_elixir::HandleDummy(), spell_mage_polymorph_cast_visual::HandleDummy(), spell_q12634_despawn_fruit_tosser::HandleDummy(), Unit::HandleDummyAuraProc(), spell_shadowfang_keep_forsaken_skills_aura::HandleDummyTick(), spell_lich_king_vo_blocker::HandleEffectApply(), spell_midsummer_ribbon_pole::HandleEffectApply(), spell_gen_haunted_aura::HandleEffectCalcPeriodic(), spell_hor_gunship_cannon_fire_aura::HandleEffectPeriodic(), spell_pos_empowered_blizzard_aura::HandleEffectPeriodic(), spell_gen_haunted_aura::HandleEffectPeriodic(), spell_valkyr_touch_aura::HandleEffectPeriodic(), boss_warbringer_omrogg::HandleHeadTalk(), spell_item_crazy_alchemists_potion::HandleHeal(), spell_magtheridon_quake::HandleHit(), boss_malygos::boss_malygosAI::HandleIntroSpeech(), spell_yogg_saron_brain_link_aura::HandleOnEffectApply(), spell_gen_haunted::HandleOnEffectHit(), spell_gen_baby_murloc_passive::HandlePeriodicTimer(), WorldSession::HandlePetActionHelper(), WorldSession::HandlePetCastSpellOpcode(), npc_echo_of_medivh::HandlePieceMoveByAI(), spell_item_magic_dust::HandlePreventAura(), spell_kormok_summon_bone_mages::HandleScript(), spell_gen_netherbloom::HandleScript(), spell_gen_upper_deck_create_foam_sword::HandleScript(), spell_item_scroll_of_recall::HandleScript(), spell_gen_elemental_shield::HandleScript(), spell_hallows_end_trick::HandleScript(), spell_putricide_choking_gas_bomb::HandleScript(), spell_gen_elune_candle::HandleScript(), spell_item_dimensional_ripper_area52::HandleScript(), spell_q12698_the_gift_that_keeps_on_giving::HandleScriptEffect(), spell_winter_veil_shoot_air_rifle::HandleScriptEffect(), spell_item_mirrens_drinking_hat::HandleScriptEffect(), spell_item_draenic_pale_ale::HandleSummon(), Battleground::HandleTriggerBuff(), spell_magic_eater_food::HandleTriggerSpell(), boss_yoggsaron_sara::boss_yoggsaron_saraAI::InformCloud(), BattlegroundSA::Init(), instance_blackrock_depths::instance_blackrock_depths_InstanceMapScript::Initialize(), npc_troll_volunteer::npc_troll_volunteerAI::InitializeAI(), npc_pet_gen_imp_in_a_bottle::InitializeAI(), npc_wormhole::npc_wormholeAI::InitializeAI(), npc_chesspiece::InitializeCombatSpellsByEntry(), npc_scarlet_miner::npc_scarlet_minerAI::InitWaypoint(), instance_karazhan::instance_karazhan_InstanceMapScript::instance_karazhan_InstanceMapScript(), boss_azuregos::boss_azuregosAI::JustDied(), boss_volazj::JustDied(), npc_ghostly_priest::npc_ghostly_priestAI::JustDied(), npc_phantom_mage::npc_phantom_mageAI::JustDied(), npc_shadowy_mercenary::npc_shadowy_mercenaryAI::JustDied(), npc_spectral_footman::npc_spectral_footmanAI::JustDied(), npc_tortured_rifleman::npc_tortured_riflemanAI::JustDied(), npc_webbed_creature::npc_webbed_creatureAI::JustDied(), npc_nerubar_victim::npc_nerubar_victimAI::JustDied(), boss_crone::JustEngagedWith(), boss_priestess_delrissa::JustEngagedWith(), boss_akilzon::JustEngagedWith(), npc_hyjal_ground_trash::JustEngagedWith(), npc_anubisath_defender::JustEngagedWith(), npc_anubisath_warder::JustEngagedWith(), npc_muglash::npc_muglashAI::JustEngagedWith(), boss_ichoron::boss_ichoronAI::JustEngagedWith(), boss_nexusprince_shaffar::JustEngagedWith(), boss_doomwalker::JustEngagedWith(), boss_nazan::JustEngagedWith(), npc_dragonmaw_peon::npc_dragonmaw_peonAI::JustEngagedWith(), npc_pet_shaman_fire_elemental::JustEngagedWith(), npc_belnistrasz::npc_belnistraszAI::JustEngagedWith(), npc_prospector_remtravel::npc_prospector_remtravelAI::JustEngagedWith(), boss_rotface::boss_rotfaceAI::JustEngagedWith(), boss_anubrekhan::boss_anubrekhanAI::JustEngagedWith(), boss_steelbreaker::boss_steelbreakerAI::JustEngagedWith(), npc_torturer_lecraft::npc_torturer_lecraftAI::JustEngagedWith(), boss_fathomguard_sharkkis::JustEngagedWith(), npc_artorius::npc_artoriusAI::JustEngagedWith(), npc_simone::npc_simoneAI::JustEngagedWith(), npc_nelson::npc_nelsonAI::JustEngagedWith(), npc_franklin::npc_franklinAI::JustEngagedWith(), npc_highlord_darion_mograine::npc_highlord_darion_mograineAI::JustSummoned(), boss_yoggsaron_brain::boss_yoggsaron_brainAI::JustSummoned(), npc_frosthound::npc_frosthoundAI::JustSummoned(), boss_gothik::boss_gothikAI::JustSummoned(), boss_epoch::boss_epochAI::KilledUnit(), boss_mal_ganis::boss_mal_ganisAI::KilledUnit(), boss_meathook::boss_meathookAI::KilledUnit(), boss_salramm::boss_salrammAI::KilledUnit(), boss_maiden_of_grief::boss_maiden_of_griefAI::KilledUnit(), boss_sjonnir::boss_sjonnirAI::KilledUnit(), boss_freya_elder_stonebark::boss_freya_elder_stonebarkAI::KilledUnit(), boss_freya_elder_brightleaf::boss_freya_elder_brightleafAI::KilledUnit(), boss_freya_elder_ironbranch::boss_freya_elder_ironbranchAI::KilledUnit(), boss_kologarn::boss_kologarnAI::KilledUnit(), boss_skadi::boss_skadiAI::KilledUnit(), boss_ymiron::boss_ymironAI::KilledUnit(), boss_kelidan_the_breaker::KilledUnit(), boss_sartharion::boss_sartharionAI::KilledUnit(), boss_sartharion_dragonAI::KilledUnit(), boss_sacrolash::KilledUnit(), boss_alythess::KilledUnit(), boss_hexlord_malacrass::KilledUnit(), boss_volazj::KilledUnit(), boss_algalon_the_observer::boss_algalon_the_observerAI::KilledUnit(), boss_auriaya::boss_auriayaAI::KilledUnit(), boss_freya::boss_freyaAI::KilledUnit(), boss_xt002::boss_xt002AI::KilledUnit(), boss_exarch_maladaar::KilledUnit(), boss_talon_king_ikiss::KilledUnit(), boss_ambassador_hellmaw::KilledUnit(), boss_blackheart_the_inciter::KilledUnit(), npc_akama_illidan::KilledUnit(), boss_the_maker::KilledUnit(), boss_faerlina::boss_faerlinaAI::KilledUnit(), boss_patchwerk::boss_patchwerkAI::KilledUnit(), boss_thaddius_summon::boss_thaddius_summonAI::KilledUnit(), boss_stormcaller_brundir::boss_stormcaller_brundirAI::KilledUnit(), spell_wailing_souls_periodic_aura::Load(), spell_igb_explosion_main_aura::Load(), Player::LoadFromDB(), Unit::MeleeSpellHitResult(), npc_cw_area_trigger::npc_cw_area_triggerAI::MoveInLineOfSight(), npc_love_in_air_supply_sentry::MoveInLineOfSight(), npc_chesspiece::MovementInform(), npc_concentrated_ball::npc_concentrated_ballAI::MovementInform(), npc_commander_eligor_dawnbringer::npc_commander_eligor_dawnbringerAI::MovementInform(), boss_felmyst::MovementInform(), npc_xt002_scrapbot::npc_xt002_scrapbotAI::MovementInform(), npc_akilzon_eagle::MovementInform(), npc_chesspiece::npc_chesspiece(), npc_corrupted_totem::npc_corrupted_totem(), npc_grimstone::npc_grimstoneAI::npc_grimstoneAI(), npc_hol_monument::npc_hol_monumentAI::npc_hol_monumentAI(), npc_pos_icicle_trigger::npc_pos_icicle_triggerAI::npc_pos_icicle_triggerAI(), npc_ravenclaw_apparition::npc_ravenclaw_apparitionAI::npc_ravenclaw_apparitionAI(), npc_vortex_ride::npc_vortex_rideAI::npc_vortex_rideAI(), spell_shadowfang_keep_forsaken_skills_aura::OnApply(), WaypointMovementGenerator< Creature >::OnArrived(), spell_item_ashbringer::OnDummyEffect(), instance_icecrown_citadel::instance_icecrown_citadel_InstanceMapScript::OnGameObjectCreate(), instance_karazhan::instance_karazhan_InstanceMapScript::OnUnitDeath(), boss_anetheron::PathEndReached(), boss_rage_winterchill::PathEndReached(), npc_hyjal_ground_trash::PathEndReached(), boss_malchezaar::PickTarget(), BattlegroundAV::PostUpdateImpl(), boss_yoggsaron_brain::boss_yoggsaron_brainAI::PrepareChamberIllusion(), Player::PrepareCharmAISpells(), boss_yoggsaron_brain::boss_yoggsaron_brainAI::PrepareIceCrownIllusion(), spell_gen_spectator_cheer_trigger::PrepareSpellScript(), spell_item_titanium_seal_of_dalaran::PrepareSpellScript(), spell_q11653_youre_not_so_big_now::PrepareSpellScript(), boss_yoggsaron_brain::boss_yoggsaron_brainAI::PrepareStormwindIllusion(), SmartScript::ProcessAction(), RAND(), npc_hourglass_of_eternity::npc_hourglass_of_eternityAI::randEntry(), TaskScheduler::RandomDurationBetween(), instance_halls_of_reflection::instance_halls_of_reflection_InstanceMapScript::RandomizeCompositionsAndShow(), Acore::Containers::RandomResize(), boss_alyson_antille::RandomReverseFriendlyList(), npc_hourglass_of_eternity::npc_hourglass_of_eternityAI::randomWhisper(), randtime(), SmartScript::RecalcTimer(), Weather::ReGenerate(), boss_drekthar::boss_drektharAI::Reset(), boss_galvangar::boss_galvangarAI::Reset(), boss_vanndar::boss_vanndarAI::Reset(), boss_golemagg::boss_golemaggAI::Reset(), npc_echo_of_medivh::Reset(), npc_partygoer::Reset(), npc_bh_thalorien_dawnseeker::npc_bh_thalorien_dawnseekerAI::Reset(), npc_akilzon_eagle::Reset(), boss_renataki::boss_renatakiAI::Reset(), boss_ossirian::Reset(), npc_injured_draenei::npc_injured_draeneiAI::Reset(), npc_kerlonian::npc_kerlonianAI::Reset(), npc_ringo::npc_ringoAI::Reset(), npc_shadowpriest_sezziz::npc_shadowpriest_sezzizAI::Reset(), npc_twilight_summon::npc_twilight_summonAI::Reset(), npc_swarm_scarab::npc_swarm_scarabAI::Reset(), boss_bjarngrim::boss_bjarngrimAI::Reset(), npc_algalon_worm_hole::npc_algalon_worm_holeAI::Reset(), boss_auriaya::boss_auriayaAI::Reset(), npc_mechanolift::npc_mechanoliftAI::Reset(), boss_freya::boss_freyaAI::Reset(), npc_ulduar_dark_rune_sentinel::npc_ulduar_dark_rune_sentinelAI::Reset(), boss_yoggsaron_sara::boss_yoggsaron_saraAI::Reset(), boss_palehoof::boss_palehoofAI::Reset(), boss_ymiron::boss_ymironAI::Reset(), boss_ichoron::boss_ichoronAI::Reset(), npc_valiance_keep_cannoneer::npc_valiance_keep_cannoneerAI::Reset(), npc_injured_7th_legion_soldier::npc_injured_7th_legion_soldierAI::Reset(), boss_illidan_stormrage::Reset(), npc_invis_infernal_caster::npc_invis_infernal_casterAI::Reset(), npc_pet_hunter_snake_trap::Reset(), emerald_dragonAI::Reset(), npc_firework::npc_fireworkAI::Reset(), npc_spring_rabbit::npc_spring_rabbitAI::Reset(), BattlegroundAV::ResetBGSubclass(), Creature::Respawn(), Unit::RollMeleeOutcomeAgainst(), npc_time_lost_proto_drake::npc_time_lost_proto_drakeAI::RollPath(), boss_bjarngrim::boss_bjarngrimAI::RollStance(), npc_shandy_dalaran::npc_shandy_dalaranAI::RollTask(), npc_dark_iron_guzzler::SayText(), boss_julianne::ScheduleCombat(), boss_felmyst::ScheduleFlightSequence(), boss_yoggsaron_constrictor_tentacle::boss_yoggsaron_constrictor_tentacleAI::SelectConstrictTarget(), boss_yoggsaron_corruptor_tentacle::boss_yoggsaron_corruptor_tentacleAI::SelectCorruptionTarget(), Creature::SelectLevel(), boss_skadi_grauf::boss_skadi_graufAI::SelectNextPos(), npc_midsummer_torch_target::SelectPosition(), npc_finklestein::npc_finklesteinAI::SelectRandomCode(), Acore::Containers::SelectRandomContainerElement(), Acore::Containers::SelectRandomContainerElementIf(), npc_gothik_trigger::npc_gothik_triggerAI::SelectRandomSkullPile(), ScriptedAI::SelectSpell(), boss_thorim_arena_npcs::boss_thorim_arena_npcsAI::SelectT(), ScriptedAI::SelectTargetFromPlayerList(), AutobroadcastMgr::SendAutobroadcasts(), CreatureTextMgr::SendChat(), npc_xt002_heart::npc_xt002_heartAI::SendEnergyToCorner(), Player::SendLoot(), ironhand_guardian::ironhand_guardianAI::SetData(), instance_trial_of_the_crusader::instance_trial_of_the_crusader_InstanceMapScript::SetData(), instance_trial_of_the_champion::instance_trial_of_the_champion_InstanceMapScript::SetData(), spell_mother_shahraz_fatal_attraction::SetDest(), boss_onyxia::SetPhase(), FleeingMovementGenerator< T >::SetTargetLocation(), BattlefieldWG::SetupBattlefield(), boss_hexlord_malacrass::SpawnAdds(), boss_thorim::boss_thorimAI::SpawnArenaNPCs(), boss_skadi_grauf::boss_skadi_graufAI::SpawnHelpers(), boss_yoggsaron_sara::boss_yoggsaron_saraAI::SpawnTentacle(), boss_grandmaster_vorpil::spawnVoidTraveler(), boss_freya::boss_freyaAI::SpawnWave(), npc_varian_wrynn::npc_varian_wrynnAI::SpawnWave(), npc_thrall_bfu::npc_thrall_bfuAI::SpawnWave(), npc_crusade_persuaded::npc_crusade_persuadedAI::SpellHit(), npc_pos_leader_second::npc_pos_leader_secondAI::SpellHitTarget(), npc_chesspiece::SpellHitTarget(), npc_still_at_it_trigger::npc_still_at_it_triggerAI::Start(), BattlegroundAB::StartingEventOpenDoors(), BattlegroundEY::StartingEventOpenDoors(), npc_grimstone::npc_grimstoneAI::SummonBoss(), brann_bronzebeard::brann_bronzebeardAI::SummonCreatures(), npc_ravenclaw_apparition::npc_ravenclaw_apparitionAI::SummonCrowd(), boss_yoggsaron_sara::boss_yoggsaron_saraAI::SummonDeathOrbs(), boss_sjonnir::boss_sjonnirAI::SummonDwarfes(), boss_akilzon::SummonEagles(), boss_kelthuzad::boss_kelthuzadAI::SummonHelper(), boss_noth::boss_nothAI::SummonHelper(), boss_yoggsaron::boss_yoggsaronAI::SummonImmortalGuardian(), boss_paletress::boss_paletressAI::SummonMemory(), npc_medivh_bm::SummonOrcs(), go_tadpole_cage::go_tadpole_cageAI::SummonTadpoles(), boss_lady_deathwhisper::boss_lady_deathwhisperAI::SummonWaveP1(), boss_lady_deathwhisper::boss_lady_deathwhisperAI::SummonWaveP2(), boss_fankriss::SummonWorms(), BattlegroundSA::TeleportToEntrancePosition(), TriggerBurningPitch(), boss_archimonde::UnleashSoulCharge(), spell_item_goblin_gumbo_kettle::Update(), spell_illidari_council_deadly_strike_aura::Update(), instance_blackwing_lair::instance_blackwing_lair_InstanceMapScript::Update(), instance_trial_of_the_champion::instance_trial_of_the_champion_InstanceMapScript::Update(), instance_trial_of_the_crusader::instance_trial_of_the_crusader_InstanceMapScript::Update(), instance_icecrown_citadel::instance_icecrown_citadel_InstanceMapScript::Update(), instance_naxxramas::instance_naxxramas_InstanceMapScript::Update(), instance_violet_hold::instance_violet_hold_InstanceMapScript::Update(), GameObject::Update(), Creature::Update(), boss_drekthar::boss_drektharAI::UpdateAI(), boss_galvangar::boss_galvangarAI::UpdateAI(), boss_vanndar::boss_vanndarAI::UpdateAI(), ironhand_guardian::ironhand_guardianAI::UpdateAI(), boss_anubshiah::boss_anubshiahAI::UpdateAI(), boss_eviscerator::boss_evisceratorAI::UpdateAI(), boss_gorosh_the_dervish::boss_gorosh_the_dervishAI::UpdateAI(), boss_grizzle::boss_grizzleAI::UpdateAI(), boss_hedrum::boss_hedrumAI::UpdateAI(), boss_moira_bronzebeardAI::UpdateAI(), boss_high_priestess_thaurissanAI::UpdateAI(), boss_okthor::boss_okthorAI::UpdateAI(), boss_ragnaros::boss_ragnarosAI::UpdateAI(), npc_flamewaker_priest::npc_flamewaker_priestAI::UpdateAI(), npc_mc_core_hound::npc_mc_core_houndAI::UpdateAI(), npc_echo_of_medivh::UpdateAI(), npc_chesspiece::UpdateAI(), npc_high_inquisitor_valroth::npc_high_inquisitor_valrothAI::UpdateAI(), boss_darkmaster_gandling::boss_darkmaster_gandlingAI::UpdateAI(), npc_scholomance_occultist::npc_scholomance_occultistAI::UpdateAI(), npc_balance_of_light_and_shadow::npc_balance_of_light_and_shadowAI::UpdateAI(), npc_partygoer_pather::UpdateAI(), npc_partygoer::UpdateAI(), npc_bh_thalorien_dawnseeker::npc_bh_thalorien_dawnseekerAI::UpdateAI(), npc_akilzon_eagle::UpdateAI(), npc_forest_frog::UpdateAI(), boss_arlokk::boss_arlokkAI::UpdateAI(), boss_renataki::boss_renatakiAI::UpdateAI(), npc_dark_iron_attack_generator::UpdateAI(), boss_headless_horseman_head::UpdateAI(), boss_salramm::boss_salrammAI::UpdateAI(), boss_onyxia::UpdateAI(), npc_onyxian_lair_guard::UpdateAI(), npc_belnistrasz::npc_belnistraszAI::UpdateAI(), boss_cthun::UpdateAI(), boss_skeram::UpdateAI(), npc_qiraj_war_spawn::npc_qiraj_war_spawnAI::UpdateAI(), npc_shadowpriest_sezziz::npc_shadowpriest_sezzizAI::UpdateAI(), boss_sartharion::boss_sartharionAI::UpdateAI(), boss_paletress::boss_paletressAI::UpdateAI(), boss_black_knight::boss_black_knightAI::UpdateAI(), npc_toc5_grand_champion_minion::npc_toc5_grand_champion_minionAI::UpdateAI(), boss_grand_champion::boss_grand_championAI::UpdateAI(), boss_anubarak_trial::boss_anubarak_trialAI::UpdateAI(), npc_swarm_scarab::npc_swarm_scarabAI::UpdateAI(), boss_faction_championsAI::UpdateAI(), npc_toc_priest::npc_toc_priestAI::UpdateAI(), npc_toc_shadow_priest::npc_toc_shadow_priestAI::UpdateAI(), npc_snobold_vassal::npc_snobold_vassalAI::UpdateAI(), boss_gormok::boss_gormokAI::UpdateAI(), boss_jormungarAI::UpdateAI(), boss_twin_valkyrAI::UpdateAI(), boss_ick::boss_ickAI::UpdateAI(), npc_pos_leader::npc_pos_leaderAI::UpdateAI(), npc_pos_icicle_trigger::npc_pos_icicle_triggerAI::UpdateAI(), npc_rimefang::npc_rimefangAI::UpdateAI(), boss_the_lich_king::boss_the_lich_kingAI::UpdateAI(), boss_gluth::boss_gluthAI::UpdateAI(), boss_kelthuzad::boss_kelthuzadAI::UpdateAI(), boss_sapphiron::boss_sapphironAI::UpdateAI(), boss_malygos::boss_malygosAI::UpdateAI(), npc_scion_of_eternity::npc_scion_of_eternityAI::UpdateAI(), boss_eregos::boss_eregosAI::UpdateAI(), boss_stormcaller_brundir::boss_stormcaller_brundirAI::UpdateAI(), npc_mechanolift::npc_mechanoliftAI::UpdateAI(), boss_freya::boss_freyaAI::UpdateAI(), boss_freya_elder_brightleaf::boss_freya_elder_brightleafAI::UpdateAI(), boss_vezax::boss_vezaxAI::UpdateAI(), boss_ignis::boss_ignisAI::UpdateAI(), boss_kologarn::boss_kologarnAI::UpdateAI(), boss_mimiron::boss_mimironAI::UpdateAI(), npc_ulduar_leviathan_mkii::npc_ulduar_leviathan_mkiiAI::UpdateAI(), boss_razorscale::boss_razorscaleAI::UpdateAI(), npc_ulduar_dark_rune_guardian::npc_ulduar_dark_rune_guardianAI::UpdateAI(), npc_ulduar_dark_rune_watcher::npc_ulduar_dark_rune_watcherAI::UpdateAI(), npc_ulduar_dark_rune_sentinel::npc_ulduar_dark_rune_sentinelAI::UpdateAI(), boss_thorim_sif::boss_thorim_sifAI::UpdateAI(), boss_thorim_runic_colossus::boss_thorim_runic_colossusAI::UpdateAI(), boss_yoggsaron_sara::boss_yoggsaron_saraAI::UpdateAI(), boss_emalon::boss_emalonAI::UpdateAI(), violet_hold_trashAI::UpdateAI(), npc_azure_invader::npc_azure_invaderAI::UpdateAI(), npc_azure_raider::npc_azure_raiderAI::UpdateAI(), npc_azure_sorceror::npc_azure_sorcerorAI::UpdateAI(), npc_valiance_keep_cannoneer::npc_valiance_keep_cannoneerAI::UpdateAI(), npc_minigob_manabonk::UpdateAI(), npc_dalaran_mage::npc_dalaran_mageAI::UpdateAI(), npc_dalaran_warrior::npc_dalaran_warriorAI::UpdateAI(), npc_commander_eligor_dawnbringer::npc_commander_eligor_dawnbringerAI::UpdateAI(), npc_blessed_banner::npc_blessed_bannerAI::UpdateAI(), npc_still_at_it_trigger::npc_still_at_it_triggerAI::UpdateAI(), npc_wild_wyrm::npc_wild_wyrmAI::UpdateAI(), npc_maghar_captive::npc_maghar_captiveAI::UpdateAI(), npc_dragonmaw_peon::npc_dragonmaw_peonAI::UpdateAI(), npc_pet_hunter_snake_trap::UpdateAI(), npc_pet_shaman_earth_elemental::UpdateAI(), npc_pet_shaman_fire_elemental::UpdateAI(), go_flames::go_flamesAI::UpdateAI(), go_heat::go_heatAI::UpdateAI(), go_brewfest_music::go_brewfest_musicAI::UpdateAI(), npc_artorius::npc_artoriusAI::UpdateAI(), npc_simone::npc_simoneAI::UpdateAI(), npc_nelson::npc_nelsonAI::UpdateAI(), npc_franklin::npc_franklinAI::UpdateAI(), npc_spring_rabbit::npc_spring_rabbitAI::UpdateAI(), boss_ichoron::boss_ichoronAI::UpdateAI(), npc_warmage_coldarra::npc_warmage_coldarraAI::UpdateAI(), PetAI::UpdateAI(), Player::UpdateCharmedAI(), brann_bronzebeard::brann_bronzebeardAI::UpdateEscortAI(), npc_kurenai_captive::npc_kurenai_captiveAI::UpdateEscortAI(), npc_kerlonian::npc_kerlonianAI::UpdateFollowerAI(), npc_tooga::npc_toogaAI::UpdateFollowerAI(), npc_ringo::npc_ringoAI::UpdateFollowerAI(), urandms(), boss_hexlord_malacrass::UseAbility(), and WeatherForcast().

◆ urandms()

uint32 urandms ( uint32  min,
uint32  max 
)
52{
53 ASSERT(std::numeric_limits<uint32>::max() / Milliseconds::period::den >= max);
54 return urand(min * Milliseconds::period::den, max * Milliseconds::period::den);
55}

References ASSERT, and urand().

◆ urandweighted()

uint32 urandweighted ( std::size_t  count,
double const *  chances 
)
90{
91 std::discrete_distribution<uint32> dd(chances, chances + count);
92 return dd(engine);
93}

References engine.

Referenced by Acore::Containers::SelectRandomWeightedContainerElement().

Variable Documentation

◆ engine

◆ sfmtRand

thread_local std::unique_ptr<SFMTRand> sfmtRand
static

Referenced by GetRng().