From 7fff320a0445b15ada34ee2a65ea77bdb9668504 Mon Sep 17 00:00:00 2001 From: AlexDereka Date: Mon, 15 Feb 2010 00:16:35 +0300 Subject: [PATCH] [9386] Store some config values in Rate emun. --- src/game/AchievementMgr.cpp | 14 ++-- src/game/AggressorAI.cpp | 2 +- src/game/AuctionHouseMgr.cpp | 2 +- src/game/BattleGroundMgr.cpp | 6 +- src/game/ChatHandler.cpp | 4 +- src/game/Creature.cpp | 4 +- src/game/CreatureEventAI.cpp | 2 +- src/game/CreatureEventAIMgr.cpp | 6 +- src/game/GMTicketMgr.cpp | 2 +- src/game/GameEventMgr.cpp | 12 ++-- src/game/Group.cpp | 14 ++-- src/game/GuardAI.cpp | 2 +- src/game/InstanceSaveMgr.cpp | 2 +- src/game/ItemEnchantmentMgr.cpp | 2 +- src/game/LootHandler.cpp | 2 +- src/game/LootMgr.cpp | 4 +- src/game/Object.cpp | 14 ++-- src/game/ObjectMgr.cpp | 112 ++++++++++++++++---------------- src/game/PetAI.cpp | 2 +- src/game/Player.cpp | 12 ++-- src/game/PoolManager.cpp | 8 +-- src/game/SkillDiscovery.cpp | 4 +- src/game/SkillExtraItems.cpp | 2 +- src/game/SpellMgr.cpp | 16 ++--- src/game/Transports.cpp | 2 +- src/game/Unit.cpp | 4 +- src/game/WaypointManager.cpp | 2 +- src/game/World.cpp | 25 +++---- src/game/World.h | 33 ++++------ src/shared/Common.h | 2 +- src/shared/Util.cpp | 5 ++ src/shared/Util.h | 2 + src/shared/revision_nr.h | 2 +- 33 files changed, 163 insertions(+), 164 deletions(-) diff --git a/src/game/AchievementMgr.cpp b/src/game/AchievementMgr.cpp index f4f4600811d..314a47e9c84 100644 --- a/src/game/AchievementMgr.cpp +++ b/src/game/AchievementMgr.cpp @@ -625,9 +625,9 @@ void AchievementMgr::SendAchievementEarned(AchievementEntry const* achievement) MaNGOS::AchievementChatBuilder say_builder(*GetPlayer(), CHAT_MSG_ACHIEVEMENT, LANG_ACHIEVEMENT_EARNED,achievement->ID); MaNGOS::LocalizedPacketDo say_do(say_builder); - MaNGOS::PlayerDistWorker > say_worker(GetPlayer(),sWorld.getConfig(CONFIG_LISTEN_RANGE_SAY),say_do); + MaNGOS::PlayerDistWorker > say_worker(GetPlayer(),sWorld.getRate(RATE_LISTEN_RANGE_SAY),say_do); TypeContainerVisitor >, WorldTypeMapContainer > message(say_worker); - cell.Visit(p, message, *GetPlayer()->GetMap(), *GetPlayer(), sWorld.getConfig(CONFIG_LISTEN_RANGE_SAY)); + cell.Visit(p, message, *GetPlayer()->GetMap(), *GetPlayer(), sWorld.getRate(RATE_LISTEN_RANGE_SAY)); } WorldPacket data(SMSG_ACHIEVEMENT_EARNED, 8+4+8); @@ -635,7 +635,7 @@ void AchievementMgr::SendAchievementEarned(AchievementEntry const* achievement) data << uint32(achievement->ID); data << uint32(secsToTimeBitFields(time(NULL))); data << uint32(0); - GetPlayer()->SendMessageToSetInRange(&data, sWorld.getConfig(CONFIG_LISTEN_RANGE_SAY), true); + GetPlayer()->SendMessageToSetInRange(&data, sWorld.getRate(RATE_LISTEN_RANGE_SAY), true); } void AchievementMgr::SendCriteriaUpdate(uint32 id, CriteriaProgress const* progress) @@ -1900,7 +1900,7 @@ void AchievementGlobalMgr::LoadAchievementCriteriaRequirements() uint32 count = 0; uint32 disabled_count = 0; - barGoLink bar(result->GetRowCount()); + barGoLink bar((int)result->GetRowCount()); do { bar.step(); @@ -2023,7 +2023,7 @@ void AchievementGlobalMgr::LoadCompletedAchievements() return; } - barGoLink bar(result->GetRowCount()); + barGoLink bar((int)result->GetRowCount()); do { bar.step(); @@ -2066,7 +2066,7 @@ void AchievementGlobalMgr::LoadRewards() } uint32 count = 0; - barGoLink bar(result->GetRowCount()); + barGoLink bar((int)result->GetRowCount()); do { @@ -2176,7 +2176,7 @@ void AchievementGlobalMgr::LoadRewardLocales() return; } - barGoLink bar(result->GetRowCount()); + barGoLink bar((int)result->GetRowCount()); do { diff --git a/src/game/AggressorAI.cpp b/src/game/AggressorAI.cpp index 5fe3981babd..6cc999ae6c5 100644 --- a/src/game/AggressorAI.cpp +++ b/src/game/AggressorAI.cpp @@ -141,7 +141,7 @@ AggressorAI::UpdateAI(const uint32 /*diff*/) bool AggressorAI::IsVisible(Unit *pl) const { - return m_creature->IsWithinDist(pl,sWorld.getConfig(CONFIG_SIGHT_MONSTER)) + return m_creature->IsWithinDist(pl,sWorld.getRate(RATE_SIGHT_MONSTER)) && pl->isVisibleForOrDetect(m_creature,m_creature,true); } diff --git a/src/game/AuctionHouseMgr.cpp b/src/game/AuctionHouseMgr.cpp index 115dece8eae..d729de26f3b 100644 --- a/src/game/AuctionHouseMgr.cpp +++ b/src/game/AuctionHouseMgr.cpp @@ -292,7 +292,7 @@ void AuctionHouseMgr::LoadAuctionItems() return; } - barGoLink bar( result->GetRowCount() ); + barGoLink bar( (int)result->GetRowCount() ); uint32 count = 0; diff --git a/src/game/BattleGroundMgr.cpp b/src/game/BattleGroundMgr.cpp index d55b277e5b2..4323b9deb42 100644 --- a/src/game/BattleGroundMgr.cpp +++ b/src/game/BattleGroundMgr.cpp @@ -1660,7 +1660,7 @@ void BattleGroundMgr::CreateInitialBattleGrounds() return; } - barGoLink bar(result->GetRowCount()); + barGoLink bar((int)result->GetRowCount()); do { @@ -2050,7 +2050,7 @@ void BattleGroundMgr::LoadBattleMastersEntry() return; } - barGoLink bar( result->GetRowCount() ); + barGoLink bar( (int)result->GetRowCount() ); do { @@ -2148,7 +2148,7 @@ void BattleGroundMgr::LoadBattleEventIndexes() return; } - barGoLink bar(result->GetRowCount()); + barGoLink bar((int)result->GetRowCount()); do { diff --git a/src/game/ChatHandler.cpp b/src/game/ChatHandler.cpp index 94db570344c..b2f5631e959 100644 --- a/src/game/ChatHandler.cpp +++ b/src/game/ChatHandler.cpp @@ -580,9 +580,9 @@ void WorldSession::HandleTextEmoteOpcode( WorldPacket & recv_data ) MaNGOS::EmoteChatBuilder emote_builder(*GetPlayer(), text_emote, emoteNum, unit); MaNGOS::LocalizedPacketDo emote_do(emote_builder); - MaNGOS::PlayerDistWorker > emote_worker(GetPlayer(), sWorld.getConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE), emote_do); + MaNGOS::PlayerDistWorker > emote_worker(GetPlayer(), sWorld.getRate(RATE_LISTEN_RANGE_TEXTEMOTE), emote_do); TypeContainerVisitor >, WorldTypeMapContainer> message(emote_worker); - cell.Visit(p, message, *GetPlayer()->GetMap(), *GetPlayer(), sWorld.getConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE)); + cell.Visit(p, message, *GetPlayer()->GetMap(), *GetPlayer(), sWorld.getRate(RATE_LISTEN_RANGE_TEXTEMOTE)); GetPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DO_EMOTE, text_emote, 0, unit); diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp index d607a87bac9..71293ae1fde 100644 --- a/src/game/Creature.cpp +++ b/src/game/Creature.cpp @@ -537,7 +537,7 @@ void Creature::DoFleeToGetAssistance() if (!getVictim()) return; - float radius = sWorld.getConfig(CONFIG_CREATURE_FAMILY_FLEE_ASSISTANCE_RADIUS); + float radius = sWorld.getRate(RATE_CREATURE_FAMILY_FLEE_ASSISTANCE_RADIUS); if (radius >0) { Creature* pCreature = NULL; @@ -1509,7 +1509,7 @@ void Creature::CallAssistance() { SetNoCallAssistance(true); - float radius = sWorld.getConfig(CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS); + float radius = sWorld.getRate(RATE_CREATURE_FAMILY_ASSISTANCE_RADIUS); if(radius > 0) { std::list assistList; diff --git a/src/game/CreatureEventAI.cpp b/src/game/CreatureEventAI.cpp index c11fe68e6ce..98d6b6bc233 100644 --- a/src/game/CreatureEventAI.cpp +++ b/src/game/CreatureEventAI.cpp @@ -1136,7 +1136,7 @@ void CreatureEventAI::UpdateAI(const uint32 diff) bool CreatureEventAI::IsVisible(Unit *pl) const { - return m_creature->IsWithinDist(pl,(float)sWorld.getConfig(CONFIG_SIGHT_MONSTER)) + return m_creature->IsWithinDist(pl,sWorld.getRate(RATE_SIGHT_MONSTER)) && pl->isVisibleForOrDetect(m_creature,m_creature,true); } diff --git a/src/game/CreatureEventAIMgr.cpp b/src/game/CreatureEventAIMgr.cpp index e57cf78dc5f..0d81aba9c45 100644 --- a/src/game/CreatureEventAIMgr.cpp +++ b/src/game/CreatureEventAIMgr.cpp @@ -44,7 +44,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Texts(bool check_entry_use) sLog.outString("Loading EventAI Texts additional data..."); if (result) { - barGoLink bar(result->GetRowCount()); + barGoLink bar((int)result->GetRowCount()); uint32 count = 0; do @@ -159,7 +159,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Summons(bool check_entry_use) QueryResult *result = WorldDatabase.Query("SELECT id, position_x, position_y, position_z, orientation, spawntimesecs FROM creature_ai_summons"); if (result) { - barGoLink bar(result->GetRowCount()); + barGoLink bar((int)result->GetRowCount()); uint32 Count = 0; do @@ -253,7 +253,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts() "FROM creature_ai_scripts"); if (result) { - barGoLink bar(result->GetRowCount()); + barGoLink bar((int)result->GetRowCount()); uint32 Count = 0; do diff --git a/src/game/GMTicketMgr.cpp b/src/game/GMTicketMgr.cpp index b9e40f24f5f..18f73aec500 100644 --- a/src/game/GMTicketMgr.cpp +++ b/src/game/GMTicketMgr.cpp @@ -48,7 +48,7 @@ void GMTicketMgr::LoadGMTickets() return; } - barGoLink bar( result->GetRowCount() ); + barGoLink bar( (int)result->GetRowCount() ); uint32 count = 0; diff --git a/src/game/GameEventMgr.cpp b/src/game/GameEventMgr.cpp index 5a2329e1b86..2143011545d 100644 --- a/src/game/GameEventMgr.cpp +++ b/src/game/GameEventMgr.cpp @@ -121,7 +121,7 @@ void GameEventMgr::LoadFromDB() uint32 count = 0; { - barGoLink bar( result->GetRowCount() ); + barGoLink bar( (int)result->GetRowCount() ); do { ++count; @@ -187,7 +187,7 @@ void GameEventMgr::LoadFromDB() else { - barGoLink bar( result->GetRowCount() ); + barGoLink bar( (int)result->GetRowCount() ); do { Field *fields = result->Fetch(); @@ -233,7 +233,7 @@ void GameEventMgr::LoadFromDB() else { - barGoLink bar( result->GetRowCount() ); + barGoLink bar( (int)result->GetRowCount() ); do { Field *fields = result->Fetch(); @@ -281,7 +281,7 @@ void GameEventMgr::LoadFromDB() else { - barGoLink bar( result->GetRowCount() ); + barGoLink bar( (int)result->GetRowCount() ); do { Field *fields = result->Fetch(); @@ -338,7 +338,7 @@ void GameEventMgr::LoadFromDB() else { - barGoLink bar( result->GetRowCount() ); + barGoLink bar( (int)result->GetRowCount() ); do { Field *fields = result->Fetch(); @@ -382,7 +382,7 @@ void GameEventMgr::LoadFromDB() else { - barGoLink bar2( result->GetRowCount() ); + barGoLink bar2( (int)result->GetRowCount() ); do { Field *fields = result->Fetch(); diff --git a/src/game/Group.cpp b/src/game/Group.cpp index 316d333da85..1532fdbb744 100644 --- a/src/game/Group.cpp +++ b/src/game/Group.cpp @@ -566,7 +566,7 @@ void Group::GroupLoot(const uint64& playerGUID, Loot *loot, Creature *creature) continue; if ( i->AllowedForPlayer(member) ) { - if (member->IsWithinDist(creature, sWorld.getConfig(CONFIG_GROUP_XP_DISTANCE), false)) + if (member->IsWithinDist(creature, sWorld.getRate(RATE_GROUP_XP_DISTANCE), false)) { r->playerVote[member->GetGUID()] = NOT_EMITED_YET; ++r->totalPlayersRolling; @@ -615,7 +615,7 @@ void Group::NeedBeforeGreed(const uint64& playerGUID, Loot *loot, Creature *crea if (playerToRoll->CanUseItem(item) && i->AllowedForPlayer(playerToRoll) ) { - if (playerToRoll->IsWithinDist(creature, sWorld.getConfig(CONFIG_GROUP_XP_DISTANCE), false)) + if (playerToRoll->IsWithinDist(creature, sWorld.getRate(RATE_GROUP_XP_DISTANCE), false)) { r->playerVote[playerToRoll->GetGUID()] = NOT_EMITED_YET; ++r->totalPlayersRolling; @@ -663,7 +663,7 @@ void Group::MasterLoot(const uint64& playerGUID, Loot* /*loot*/, Creature *creat if (!looter->IsInWorld()) continue; - if (looter->IsWithinDist(creature, sWorld.getConfig(CONFIG_GROUP_XP_DISTANCE), false)) + if (looter->IsWithinDist(creature, sWorld.getRate(RATE_GROUP_XP_DISTANCE), false)) { data << looter->GetGUID(); ++real_count; @@ -675,7 +675,7 @@ void Group::MasterLoot(const uint64& playerGUID, Loot* /*loot*/, Creature *creat for(GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next()) { Player *looter = itr->getSource(); - if (looter->IsWithinDist(creature, sWorld.getConfig(CONFIG_GROUP_XP_DISTANCE), false)) + if (looter->IsWithinDist(creature, sWorld.getRate(RATE_GROUP_XP_DISTANCE), false)) looter->GetSession()->SendPacket(&data); } } @@ -1374,7 +1374,7 @@ void Group::UpdateLooterGuid( Creature* creature, bool ifneed ) { // not update if only update if need and ok Player* looter = ObjectAccessor::FindPlayer(guid_itr->guid); - if(looter && looter->IsWithinDist(creature, sWorld.getConfig(CONFIG_GROUP_XP_DISTANCE), false)) + if(looter && looter->IsWithinDist(creature, sWorld.getRate(RATE_GROUP_XP_DISTANCE), false)) return; } ++guid_itr; @@ -1387,7 +1387,7 @@ void Group::UpdateLooterGuid( Creature* creature, bool ifneed ) { if(Player* pl = ObjectAccessor::FindPlayer(itr->guid)) { - if (pl->IsWithinDist(creature, sWorld.getConfig(CONFIG_GROUP_XP_DISTANCE), false)) + if (pl->IsWithinDist(creature, sWorld.getRate(RATE_GROUP_XP_DISTANCE), false)) { bool refresh = pl->GetLootGUID() == creature->GetGUID(); @@ -1408,7 +1408,7 @@ void Group::UpdateLooterGuid( Creature* creature, bool ifneed ) { if(Player* pl = ObjectAccessor::FindPlayer(itr->guid)) { - if (pl->IsWithinDist(creature, sWorld.getConfig(CONFIG_GROUP_XP_DISTANCE), false)) + if (pl->IsWithinDist(creature, sWorld.getRate(RATE_GROUP_XP_DISTANCE), false)) { bool refresh = pl->GetLootGUID()==creature->GetGUID(); diff --git a/src/game/GuardAI.cpp b/src/game/GuardAI.cpp index 93c1df68595..eb8ee62f9a8 100644 --- a/src/game/GuardAI.cpp +++ b/src/game/GuardAI.cpp @@ -125,7 +125,7 @@ void GuardAI::UpdateAI(const uint32 /*diff*/) bool GuardAI::IsVisible(Unit *pl) const { - return m_creature->IsWithinDist(pl,sWorld.getConfig(CONFIG_SIGHT_GUARDER)) + return m_creature->IsWithinDist(pl,sWorld.getRate(RATE_SIGHT_GUARDER)) && pl->isVisibleForOrDetect(m_creature,m_creature,true); } diff --git a/src/game/InstanceSaveMgr.cpp b/src/game/InstanceSaveMgr.cpp index cb8d9d24125..49e987832d2 100644 --- a/src/game/InstanceSaveMgr.cpp +++ b/src/game/InstanceSaveMgr.cpp @@ -475,7 +475,7 @@ void InstanceSaveManager::LoadResetTimes() continue; // the reset_delay must be at least one day - uint32 period = (mapDiff->resetTime / DAY * sWorld.getRate(RATE_INSTANCE_RESET_TIME)) * DAY; + uint32 period = uint32(mapDiff->resetTime / DAY * sWorld.getRate(RATE_INSTANCE_RESET_TIME)) * DAY; time_t t = GetResetTimeFor(mapid,difficulty); if(!t) diff --git a/src/game/ItemEnchantmentMgr.cpp b/src/game/ItemEnchantmentMgr.cpp index 85d6c6a1fe8..8d0c6c69ccf 100644 --- a/src/game/ItemEnchantmentMgr.cpp +++ b/src/game/ItemEnchantmentMgr.cpp @@ -57,7 +57,7 @@ void LoadRandomEnchantmentsTable() if (result) { - barGoLink bar(result->GetRowCount()); + barGoLink bar((int)result->GetRowCount()); do { diff --git a/src/game/LootHandler.cpp b/src/game/LootHandler.cpp index 173147e098b..2d3d8b5f2c9 100644 --- a/src/game/LootHandler.cpp +++ b/src/game/LootHandler.cpp @@ -221,7 +221,7 @@ void WorldSession::HandleLootMoneyOpcode( WorldPacket & /*recv_data*/ ) Player* playerGroup = itr->getSource(); if(!playerGroup) continue; - if (player->IsWithinDistInMap(playerGroup,sWorld.getConfig(CONFIG_GROUP_XP_DISTANCE),false)) + if (player->IsWithinDistInMap(playerGroup,sWorld.getRate(RATE_GROUP_XP_DISTANCE),false)) playersNear.push_back(playerGroup); } diff --git a/src/game/LootMgr.cpp b/src/game/LootMgr.cpp index 6a2c5d9ae8f..b76017d1f74 100644 --- a/src/game/LootMgr.cpp +++ b/src/game/LootMgr.cpp @@ -102,7 +102,7 @@ void LootStore::LoadLootTable() if (result) { - barGoLink bar(result->GetRowCount()); + barGoLink bar((int)result->GetRowCount()); do { @@ -816,7 +816,7 @@ LootStoreItem const * LootTemplate::LootGroup::Roll() const { if (!ExplicitlyChanced.empty()) // First explicitly chanced entries are checked { - float Roll = rand_chance(); + float Roll = rand_chance_f(); for (uint32 i=0; i say_do(say_build); - MaNGOS::PlayerDistWorker > say_worker(this,sWorld.getConfig(CONFIG_LISTEN_RANGE_SAY),say_do); + MaNGOS::PlayerDistWorker > say_worker(this,sWorld.getRate(RATE_LISTEN_RANGE_SAY),say_do); TypeContainerVisitor >, WorldTypeMapContainer > message(say_worker); - cell.Visit(p, message, *GetMap(), *this, sWorld.getConfig(CONFIG_LISTEN_RANGE_SAY)); + cell.Visit(p, message, *GetMap(), *this, sWorld.getRate(RATE_LISTEN_RANGE_SAY)); } void WorldObject::MonsterYell(int32 textId, uint32 language, uint64 TargetGuid) @@ -1516,7 +1516,7 @@ void WorldObject::MonsterYell(int32 textId, uint32 language, uint64 TargetGuid) cell.data.Part.reserved = ALL_DISTRICT; cell.SetNoCreate(); - float range = sWorld.getConfig(CONFIG_LISTEN_RANGE_YELL); + float range = sWorld.getRate(RATE_LISTEN_RANGE_YELL); MaNGOS::MonsterChatBuilder say_build(*this, CHAT_MSG_MONSTER_YELL, textId,language,TargetGuid); MaNGOS::LocalizedPacketDo say_do(say_build); @@ -1546,7 +1546,7 @@ void WorldObject::MonsterTextEmote(int32 textId, uint64 TargetGuid, bool IsBossE cell.data.Part.reserved = ALL_DISTRICT; cell.SetNoCreate(); - float range = sWorld.getConfig(IsBossEmote ? CONFIG_LISTEN_RANGE_YELL : CONFIG_LISTEN_RANGE_TEXTEMOTE); + float range = sWorld.getRate(IsBossEmote ? RATE_LISTEN_RANGE_YELL : RATE_LISTEN_RANGE_TEXTEMOTE); MaNGOS::MonsterChatBuilder say_build(*this, IsBossEmote ? CHAT_MSG_RAID_BOSS_EMOTE : CHAT_MSG_MONSTER_EMOTE, textId,LANG_UNIVERSAL,TargetGuid); MaNGOS::LocalizedPacketDo say_do(say_build); diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index 333e6be2b91..8347d9e41c5 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -275,7 +275,7 @@ void ObjectMgr::LoadCreatureLocales() return; } - barGoLink bar(result->GetRowCount()); + barGoLink bar((int)result->GetRowCount()); do { @@ -343,7 +343,7 @@ void ObjectMgr::LoadGossipMenuItemsLocales() return; } - barGoLink bar(result->GetRowCount()); + barGoLink bar((int)result->GetRowCount()); do { @@ -407,7 +407,7 @@ void ObjectMgr::LoadPointOfInterestLocales() return; } - barGoLink bar(result->GetRowCount()); + barGoLink bar((int)result->GetRowCount()); do { @@ -1054,7 +1054,7 @@ void ObjectMgr::LoadCreatures() if (GetMapDifficultyData(i,Difficulty(k))) spawnMasks[i] |= (1 << k); - barGoLink bar(result->GetRowCount()); + barGoLink bar((int)result->GetRowCount()); do { @@ -1246,7 +1246,7 @@ void ObjectMgr::LoadGameobjects() if (GetMapDifficultyData(i,Difficulty(k))) spawnMasks[i] |= (1 << k); - barGoLink bar(result->GetRowCount()); + barGoLink bar((int)result->GetRowCount()); do { @@ -1414,7 +1414,7 @@ void ObjectMgr::LoadCreatureRespawnTimes() return; } - barGoLink bar(result->GetRowCount()); + barGoLink bar((int)result->GetRowCount()); do { @@ -1456,7 +1456,7 @@ void ObjectMgr::LoadGameobjectRespawnTimes() return; } - barGoLink bar(result->GetRowCount()); + barGoLink bar((int)result->GetRowCount()); do { @@ -1587,7 +1587,7 @@ void ObjectMgr::LoadItemLocales() return; } - barGoLink bar(result->GetRowCount()); + barGoLink bar((int)result->GetRowCount()); do { @@ -2106,7 +2106,7 @@ void ObjectMgr::LoadItemRequiredTarget() return; } - barGoLink bar(result->GetRowCount()); + barGoLink bar((int)result->GetRowCount()); do { @@ -2210,7 +2210,7 @@ void ObjectMgr::LoadPetLevelInfo() return; } - barGoLink bar( result->GetRowCount() ); + barGoLink bar( (int)result->GetRowCount() ); do { @@ -2324,7 +2324,7 @@ void ObjectMgr::LoadPlayerInfo() exit(1); } - barGoLink bar( result->GetRowCount() ); + barGoLink bar( (int)result->GetRowCount() ); do { @@ -2416,7 +2416,7 @@ void ObjectMgr::LoadPlayerInfo() } else { - barGoLink bar( result->GetRowCount() ); + barGoLink bar( (int)result->GetRowCount() ); do { @@ -2485,7 +2485,7 @@ void ObjectMgr::LoadPlayerInfo() } else { - barGoLink bar( result->GetRowCount() ); + barGoLink bar( (int)result->GetRowCount() ); do { @@ -2544,7 +2544,7 @@ void ObjectMgr::LoadPlayerInfo() } else { - barGoLink bar( result->GetRowCount() ); + barGoLink bar( (int)result->GetRowCount() ); do { @@ -2603,7 +2603,7 @@ void ObjectMgr::LoadPlayerInfo() exit(1); } - barGoLink bar( result->GetRowCount() ); + barGoLink bar( (int)result->GetRowCount() ); do { @@ -2699,7 +2699,7 @@ void ObjectMgr::LoadPlayerInfo() exit(1); } - barGoLink bar( result->GetRowCount() ); + barGoLink bar( (int)result->GetRowCount() ); do { @@ -2822,7 +2822,7 @@ void ObjectMgr::LoadPlayerInfo() exit(1); } - barGoLink bar( result->GetRowCount() ); + barGoLink bar( (int)result->GetRowCount() ); do { @@ -3011,7 +3011,7 @@ void ObjectMgr::LoadGuilds() // 0 1 2 3 4 QueryResult *guildBankTabRightsResult = CharacterDatabase.Query("SELECT guildid,TabId,rid,gbright,SlotPerDay FROM guild_bank_right ORDER BY guildid ASC, TabId ASC"); - barGoLink bar( result->GetRowCount() ); + barGoLink bar( (int)result->GetRowCount() ); do { @@ -3080,7 +3080,7 @@ void ObjectMgr::LoadArenaTeams() "SELECT arenateamid,member.guid,played_week,wons_week,played_season,wons_season,personal_rating,name,class " "FROM arena_team_member member LEFT JOIN characters chars on member.guid = chars.guid ORDER BY member.arenateamid ASC"); - barGoLink bar( result->GetRowCount() ); + barGoLink bar( (int)result->GetRowCount() ); do { @@ -3124,7 +3124,7 @@ void ObjectMgr::LoadGroups() return; } - barGoLink bar( result->GetRowCount() ); + barGoLink bar( (int)result->GetRowCount() ); do { @@ -3159,7 +3159,7 @@ void ObjectMgr::LoadGroups() { Group* group = NULL; // used as cached pointer for avoid relookup group for each member - barGoLink bar2( result->GetRowCount() ); + barGoLink bar2( (int)result->GetRowCount() ); do { bar2.step(); @@ -3225,7 +3225,7 @@ void ObjectMgr::LoadGroups() { Group* group = NULL; // used as cached pointer for avoid relookup group for each member - barGoLink bar2( result->GetRowCount() ); + barGoLink bar2( (int)result->GetRowCount() ); do { bar2.step(); @@ -3340,7 +3340,7 @@ void ObjectMgr::LoadQuests() // create multimap previous quest for each existed quest // some quests can have many previous maps set by NextQuestId in previous quest // for example set of race quests can lead to single not race specific quest - barGoLink bar( result->GetRowCount() ); + barGoLink bar((int) result->GetRowCount() ); do { bar.step(); @@ -3968,7 +3968,7 @@ void ObjectMgr::LoadQuestLocales() return; } - barGoLink bar(result->GetRowCount()); + barGoLink bar((int)result->GetRowCount()); do { @@ -4112,7 +4112,7 @@ void ObjectMgr::LoadScripts(ScriptMapMap& scripts, char const* tablename) return; } - barGoLink bar( result->GetRowCount() ); + barGoLink bar( (int)result->GetRowCount() ); do { @@ -4502,7 +4502,7 @@ void ObjectMgr::LoadItemTexts() return; } - barGoLink bar( result->GetRowCount() ); + barGoLink bar( (int)result->GetRowCount() ); Field* fields; do @@ -4584,7 +4584,7 @@ void ObjectMgr::LoadPageTextLocales() return; } - barGoLink bar(result->GetRowCount()); + barGoLink bar((int)result->GetRowCount()); do { @@ -4678,7 +4678,7 @@ void ObjectMgr::LoadGossipText() int cic; - barGoLink bar( result->GetRowCount() ); + barGoLink bar( (int)result->GetRowCount() ); do { @@ -4745,7 +4745,7 @@ void ObjectMgr::LoadNpcTextLocales() return; } - barGoLink bar(result->GetRowCount()); + barGoLink bar((int)result->GetRowCount()); do { @@ -4818,7 +4818,7 @@ void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp) //delitems << "DELETE FROM item_instance WHERE guid IN ( "; //delmails << "DELETE FROM mail WHERE id IN ( " - barGoLink bar( result->GetRowCount() ); + barGoLink bar( (int)result->GetRowCount() ); uint32 count = 0; Field *fields; @@ -4917,7 +4917,7 @@ void ObjectMgr::LoadQuestAreaTriggers() return; } - barGoLink bar( result->GetRowCount() ); + barGoLink bar((int) result->GetRowCount() ); do { @@ -4982,7 +4982,7 @@ void ObjectMgr::LoadTavernAreaTriggers() return; } - barGoLink bar( result->GetRowCount() ); + barGoLink bar( (int)result->GetRowCount() ); do { @@ -5026,7 +5026,7 @@ void ObjectMgr::LoadAreaTriggerScripts() return; } - barGoLink bar( result->GetRowCount() ); + barGoLink bar( (int)result->GetRowCount() ); do { @@ -5212,7 +5212,7 @@ void ObjectMgr::LoadGraveyardZones() return; } - barGoLink bar( result->GetRowCount() ); + barGoLink bar( (int)result->GetRowCount() ); do { @@ -5430,7 +5430,7 @@ void ObjectMgr::LoadAreaTriggerTeleports() return; } - barGoLink bar( result->GetRowCount() ); + barGoLink bar( (int)result->GetRowCount() ); do { @@ -5883,7 +5883,7 @@ void ObjectMgr::LoadGameObjectLocales() return; } - barGoLink bar(result->GetRowCount()); + barGoLink bar((int)result->GetRowCount()); do { @@ -6188,7 +6188,7 @@ void ObjectMgr::LoadExplorationBaseXP() return; } - barGoLink bar( result->GetRowCount() ); + barGoLink bar( (int)result->GetRowCount() ); do { @@ -6237,7 +6237,7 @@ void ObjectMgr::LoadPetNames() return; } - barGoLink bar( result->GetRowCount() ); + barGoLink bar( (int)result->GetRowCount() ); do { @@ -6316,7 +6316,7 @@ void ObjectMgr::LoadCorpses() return; } - barGoLink bar( result->GetRowCount() ); + barGoLink bar( (int)result->GetRowCount() ); do { @@ -6365,7 +6365,7 @@ void ObjectMgr::LoadReputationOnKill() return; } - barGoLink bar(result->GetRowCount()); + barGoLink bar((int)result->GetRowCount()); do { @@ -6442,7 +6442,7 @@ void ObjectMgr::LoadPointsOfInterest() return; } - barGoLink bar(result->GetRowCount()); + barGoLink bar((int)result->GetRowCount()); do { @@ -6496,7 +6496,7 @@ void ObjectMgr::LoadQuestPOI() return; } - barGoLink bar(result->GetRowCount()); + barGoLink bar((int)result->GetRowCount()); do { @@ -6559,7 +6559,7 @@ void ObjectMgr::LoadNPCSpellClickSpells() return; } - barGoLink bar(result->GetRowCount()); + barGoLink bar((int)result->GetRowCount()); do { @@ -6648,7 +6648,7 @@ void ObjectMgr::LoadWeatherZoneChances() return; } - barGoLink bar(result->GetRowCount()); + barGoLink bar((int)result->GetRowCount()); do { @@ -6788,7 +6788,7 @@ void ObjectMgr::LoadQuestRelationsHelper(QuestRelations& map,char const* table) return; } - barGoLink bar(result->GetRowCount()); + barGoLink bar((int)result->GetRowCount()); do { @@ -6889,7 +6889,7 @@ void ObjectMgr::LoadReservedPlayersNames() return; } - barGoLink bar( result->GetRowCount() ); + barGoLink bar((int) result->GetRowCount() ); Field* fields; do @@ -7203,7 +7203,7 @@ bool ObjectMgr::LoadMangosStrings(DatabaseType& db, char const* table, int32 min uint32 count = 0; - barGoLink bar(result->GetRowCount()); + barGoLink bar((int)result->GetRowCount()); do { @@ -7303,7 +7303,7 @@ void ObjectMgr::LoadFishingBaseSkillLevel() return; } - barGoLink bar( result->GetRowCount() ); + barGoLink bar((int) result->GetRowCount() ); do { @@ -7690,7 +7690,7 @@ void ObjectMgr::LoadGameTele() return; } - barGoLink bar( result->GetRowCount() ); + barGoLink bar( (int)result->GetRowCount() ); do { @@ -7818,7 +7818,7 @@ void ObjectMgr::LoadMailLevelRewards() return; } - barGoLink bar( result->GetRowCount() ); + barGoLink bar((int) result->GetRowCount() ); do { @@ -7888,7 +7888,7 @@ void ObjectMgr::LoadTrainerSpell() return; } - barGoLink bar( result->GetRowCount() ); + barGoLink bar( (int)result->GetRowCount() ); std::set talentIds; @@ -8001,7 +8001,7 @@ void ObjectMgr::LoadVendors() return; } - barGoLink bar( result->GetRowCount() ); + barGoLink bar( (int)result->GetRowCount() ); uint32 count = 0; do @@ -8047,7 +8047,7 @@ void ObjectMgr::LoadNpcTextId() return; } - barGoLink bar( result->GetRowCount() ); + barGoLink bar((int) result->GetRowCount() ); uint32 count = 0; uint32 guid,textid; @@ -8099,7 +8099,7 @@ void ObjectMgr::LoadGossipMenu() return; } - barGoLink bar( result->GetRowCount() ); + barGoLink bar( (int)result->GetRowCount() ); uint32 count = 0; @@ -8177,7 +8177,7 @@ void ObjectMgr::LoadGossipMenuItems() return; } - barGoLink bar(result->GetRowCount()); + barGoLink bar((int)result->GetRowCount()); uint32 count = 0; @@ -8423,7 +8423,7 @@ void ObjectMgr::LoadScriptNames() return; } - barGoLink bar( result->GetRowCount() ); + barGoLink bar( (int)result->GetRowCount() ); uint32 count = 0; do diff --git a/src/game/PetAI.cpp b/src/game/PetAI.cpp index 93bf32803b2..eab2688fac9 100644 --- a/src/game/PetAI.cpp +++ b/src/game/PetAI.cpp @@ -311,7 +311,7 @@ void PetAI::UpdateAI(const uint32 diff) bool PetAI::_isVisible(Unit *u) const { - return m_creature->IsWithinDist(u,sWorld.getConfig(CONFIG_SIGHT_GUARDER)) + return m_creature->IsWithinDist(u,sWorld.getRate(RATE_SIGHT_GUARDER)) && u->isVisibleForOrDetect(m_creature,m_creature,true); } diff --git a/src/game/Player.cpp b/src/game/Player.cpp index f2173839768..a7ef3ebe8cb 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -14905,7 +14905,7 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder ) time_t logoutTime = time_t(fields[23].GetUInt64()); // since last logout (in seconds) - uint64 time_diff = uint64(now - logoutTime); + uint32 time_diff = uint32(now - logoutTime); // set value, including drunk invisibility detection // calculate sobering. after 15 minutes logged out, the player will be sober again @@ -17129,21 +17129,21 @@ void Player::Say(const std::string& text, const uint32 language) { WorldPacket data(SMSG_MESSAGECHAT, 200); BuildPlayerChat(&data, CHAT_MSG_SAY, text, language); - SendMessageToSetInRange(&data,sWorld.getConfig(CONFIG_LISTEN_RANGE_SAY),true); + SendMessageToSetInRange(&data,sWorld.getRate(RATE_LISTEN_RANGE_SAY),true); } void Player::Yell(const std::string& text, const uint32 language) { WorldPacket data(SMSG_MESSAGECHAT, 200); BuildPlayerChat(&data, CHAT_MSG_YELL, text, language); - SendMessageToSetInRange(&data,sWorld.getConfig(CONFIG_LISTEN_RANGE_YELL),true); + SendMessageToSetInRange(&data,sWorld.getRate(RATE_LISTEN_RANGE_YELL),true); } void Player::TextEmote(const std::string& text) { WorldPacket data(SMSG_MESSAGECHAT, 200); BuildPlayerChat(&data, CHAT_MSG_EMOTE, text, LANG_UNIVERSAL); - SendMessageToSetInRange(&data,sWorld.getConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE),true, !sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHAT) ); + SendMessageToSetInRange(&data,sWorld.getRate(RATE_LISTEN_RANGE_TEXTEMOTE),true, !sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHAT) ); } void Player::Whisper(const std::string& text, uint32 language,uint64 receiver) @@ -19839,7 +19839,7 @@ void Player::RewardPlayerAndGroupAtEvent(uint32 creature_id, WorldObject* pRewar bool Player::IsAtGroupRewardDistance(WorldObject const* pRewardSource) const { - if (pRewardSource->IsWithinDistInMap(this,sWorld.getConfig(CONFIG_GROUP_XP_DISTANCE))) + if (pRewardSource->IsWithinDistInMap(this,sWorld.getRate(RATE_GROUP_XP_DISTANCE))) return true; if (isAlive()) @@ -19849,7 +19849,7 @@ bool Player::IsAtGroupRewardDistance(WorldObject const* pRewardSource) const if (!corpse) return false; - return pRewardSource->IsWithinDistInMap(corpse,sWorld.getConfig(CONFIG_GROUP_XP_DISTANCE)); + return pRewardSource->IsWithinDistInMap(corpse,sWorld.getRate(RATE_GROUP_XP_DISTANCE)); } uint32 Player::GetBaseWeaponSkillValue (WeaponAttackType attType) const diff --git a/src/game/PoolManager.cpp b/src/game/PoolManager.cpp index 7c92bc39e7f..3c56be9c923 100644 --- a/src/game/PoolManager.cpp +++ b/src/game/PoolManager.cpp @@ -418,7 +418,7 @@ void PoolManager::LoadFromDB() uint32 count = 0; - barGoLink bar(result->GetRowCount()); + barGoLink bar((int)result->GetRowCount()); do { ++count; @@ -456,7 +456,7 @@ void PoolManager::LoadFromDB() else { - barGoLink bar2(result->GetRowCount()); + barGoLink bar2((int)result->GetRowCount()); do { Field *fields = result->Fetch(); @@ -518,7 +518,7 @@ void PoolManager::LoadFromDB() else { - barGoLink bar2(result->GetRowCount()); + barGoLink bar2((int)result->GetRowCount()); do { Field *fields = result->Fetch(); @@ -587,7 +587,7 @@ void PoolManager::LoadFromDB() else { - barGoLink bar2( result->GetRowCount() ); + barGoLink bar2( (int)result->GetRowCount() ); do { Field *fields = result->Fetch(); diff --git a/src/game/SkillDiscovery.cpp b/src/game/SkillDiscovery.cpp index 612afc9847a..9ff37ef85f5 100644 --- a/src/game/SkillDiscovery.cpp +++ b/src/game/SkillDiscovery.cpp @@ -62,7 +62,7 @@ void LoadSkillDiscoveryTable() return; } - barGoLink bar(result->GetRowCount()); + barGoLink bar((int)result->GetRowCount()); std::ostringstream ssNonDiscoverableEntries; std::set reportedReqSpells; @@ -177,7 +177,7 @@ uint32 GetExplicitDiscoverySpell(uint32 spellId, Player* player) full_chance += item_iter->chance; float rate = full_chance / 100.0f; - float roll = rand_chance() * rate; // roll now in range 0..full_chance + float roll = rand_chance_f() * rate; // roll now in range 0..full_chance for(SkillDiscoveryList::const_iterator item_iter = tab->second.begin(); item_iter != tab->second.end(); ++item_iter) { diff --git a/src/game/SkillExtraItems.cpp b/src/game/SkillExtraItems.cpp index fb6f0b2eaf8..ac116acf8ef 100644 --- a/src/game/SkillExtraItems.cpp +++ b/src/game/SkillExtraItems.cpp @@ -61,7 +61,7 @@ void LoadSkillExtraItemTable() if (result) { - barGoLink bar(result->GetRowCount()); + barGoLink bar((int)result->GetRowCount()); do { diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp index 61203726715..d5e2ee5dc73 100644 --- a/src/game/SpellMgr.cpp +++ b/src/game/SpellMgr.cpp @@ -805,7 +805,7 @@ void SpellMgr::LoadSpellTargetPositions() return; } - barGoLink bar( result->GetRowCount() ); + barGoLink bar( (int)result->GetRowCount() ); do { @@ -893,7 +893,7 @@ void SpellMgr::LoadSpellProcEvents() return; } - barGoLink bar( result->GetRowCount() ); + barGoLink bar( (int)result->GetRowCount() ); uint32 customProc = 0; do { @@ -985,7 +985,7 @@ void SpellMgr::LoadSpellProcItemEnchant() return; } - barGoLink bar( result->GetRowCount() ); + barGoLink bar( (int)result->GetRowCount() ); do { @@ -1050,7 +1050,7 @@ void SpellMgr::LoadSpellBonusess() return; } - barGoLink bar( result->GetRowCount() ); + barGoLink bar( (int)result->GetRowCount() ); do { Field *fields = result->Fetch(); @@ -1182,7 +1182,7 @@ void SpellMgr::LoadSpellElixirs() return; } - barGoLink bar( result->GetRowCount() ); + barGoLink bar( (int)result->GetRowCount() ); do { @@ -1232,7 +1232,7 @@ void SpellMgr::LoadSpellThreats() return; } - barGoLink bar( result->GetRowCount() ); + barGoLink bar( (int)result->GetRowCount() ); do { @@ -1923,7 +1923,7 @@ void SpellMgr::LoadSpellChains() uint32 count = 0; - barGoLink bar( result->GetRowCount() ); + barGoLink bar( (int)result->GetRowCount() ); do { bar.step(); @@ -2131,7 +2131,7 @@ void SpellMgr::LoadSpellLearnSpells() uint32 count = 0; - barGoLink bar( result->GetRowCount() ); + barGoLink bar( (int)result->GetRowCount() ); do { bar.step(); diff --git a/src/game/Transports.cpp b/src/game/Transports.cpp index d382ea77fb3..bda7ab3cccc 100644 --- a/src/game/Transports.cpp +++ b/src/game/Transports.cpp @@ -44,7 +44,7 @@ void MapManager::LoadTransports() return; } - barGoLink bar( result->GetRowCount() ); + barGoLink bar( (int)result->GetRowCount() ); do { diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 28c8fc40116..503233876a2 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -906,9 +906,9 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa if (pVictim->GetTypeId() != TYPEID_PLAYER) { if(spellProto && IsDamageToThreatSpell(spellProto)) - pVictim->AddThreat(this, damage*2, (cleanDamage && cleanDamage->hitOutCome == MELEE_HIT_CRIT), damageSchoolMask, spellProto); + pVictim->AddThreat(this, float(damage*2), (cleanDamage && cleanDamage->hitOutCome == MELEE_HIT_CRIT), damageSchoolMask, spellProto); else - pVictim->AddThreat(this, damage, (cleanDamage && cleanDamage->hitOutCome == MELEE_HIT_CRIT), damageSchoolMask, spellProto); + pVictim->AddThreat(this, float(damage), (cleanDamage && cleanDamage->hitOutCome == MELEE_HIT_CRIT), damageSchoolMask, spellProto); } else // victim is a player { diff --git a/src/game/WaypointManager.cpp b/src/game/WaypointManager.cpp index d0c8e79de09..b6e649ebec6 100644 --- a/src/game/WaypointManager.cpp +++ b/src/game/WaypointManager.cpp @@ -88,7 +88,7 @@ void WaypointManager::Load() // 6 7 8 9 10 11 12 13 14 15 "waittime, emote, spell, textid1, textid2, textid3, textid4, textid5, id, point FROM creature_movement"); - barGoLink bar( result->GetRowCount() ); + barGoLink bar( (int)result->GetRowCount() ); do { bar.step(); diff --git a/src/game/World.cpp b/src/game/World.cpp index ca4b2242686..25662629781 100644 --- a/src/game/World.cpp +++ b/src/game/World.cpp @@ -546,8 +546,20 @@ void World::LoadConfigSettings(bool reload) rate_values[RATE_DURABILITY_LOSS_BLOCK] = 0.0f; } - ///- Read other configuration items from the config file + rate_values[RATE_LISTEN_RANGE_SAY] = sConfig.GetFloatDefault("ListenRange.Say", 25); + rate_values[RATE_LISTEN_RANGE_YELL] = sConfig.GetFloatDefault("ListenRange.Yell", 300); + rate_values[RATE_LISTEN_RANGE_TEXTEMOTE] = sConfig.GetFloatDefault("ListenRange.TextEmote", 25); + + rate_values[RATE_GROUP_XP_DISTANCE] = sConfig.GetFloatDefault("MaxGroupXPDistance", 74); + /// \todo Add MonsterSight and GuarderSight (with meaning) in mangosd.conf or put them as define + rate_values[RATE_SIGHT_GUARDER] = sConfig.GetFloatDefault("GuarderSight", 50); + rate_values[RATE_SIGHT_MONSTER] = sConfig.GetFloatDefault("MonsterSight", 50); + + rate_values[RATE_CREATURE_FAMILY_ASSISTANCE_RADIUS] = sConfig.GetFloatDefault("CreatureFamilyAssistanceRadius",10); + rate_values[RATE_CREATURE_FAMILY_FLEE_ASSISTANCE_RADIUS] = sConfig.GetFloatDefault("CreatureFamilyFleeAssistanceRadius",30); + + ///- Read other configuration items from the config file m_configs[CONFIG_COMPRESSION] = sConfig.GetIntDefault("Compression", 1); if(m_configs[CONFIG_COMPRESSION] < 1 || m_configs[CONFIG_COMPRESSION] > 9) { @@ -596,11 +608,6 @@ void World::LoadConfigSettings(bool reload) else m_configs[CONFIG_SOCKET_SELECTTIME] = sConfig.GetIntDefault("SocketSelectTime", DEFAULT_SOCKET_SELECT_TIME); - m_configs[CONFIG_GROUP_XP_DISTANCE] = sConfig.GetIntDefault("MaxGroupXPDistance", 74); - /// \todo Add MonsterSight and GuarderSight (with meaning) in mangosd.conf or put them as define - m_configs[CONFIG_SIGHT_MONSTER] = sConfig.GetIntDefault("MonsterSight", 50); - m_configs[CONFIG_SIGHT_GUARDER] = sConfig.GetIntDefault("GuarderSight", 50); - if(reload) { uint32 val = sConfig.GetIntDefault("GameType", 0); @@ -912,8 +919,6 @@ void World::LoadConfigSettings(bool reload) m_configs[CONFIG_EVENT_ANNOUNCE] = sConfig.GetIntDefault("Event.Announce",0); - m_configs[CONFIG_CREATURE_FAMILY_FLEE_ASSISTANCE_RADIUS] = sConfig.GetIntDefault("CreatureFamilyFleeAssistanceRadius",30); - m_configs[CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS] = sConfig.GetIntDefault("CreatureFamilyAssistanceRadius",10); m_configs[CONFIG_CREATURE_FAMILY_ASSISTANCE_DELAY] = sConfig.GetIntDefault("CreatureFamilyAssistanceDelay",1500); m_configs[CONFIG_CREATURE_FAMILY_FLEE_DELAY] = sConfig.GetIntDefault("CreatureFamilyFleeDelay",7000); @@ -955,10 +960,6 @@ void World::LoadConfigSettings(bool reload) m_configs[CONFIG_DECLINED_NAMES_USED] = (m_configs[CONFIG_REALM_ZONE] == REALM_ZONE_RUSSIAN) ? true : sConfig.GetBoolDefault("DeclinedNames", false); - m_configs[CONFIG_LISTEN_RANGE_SAY] = sConfig.GetIntDefault("ListenRange.Say", 25); - m_configs[CONFIG_LISTEN_RANGE_TEXTEMOTE] = sConfig.GetIntDefault("ListenRange.TextEmote", 25); - m_configs[CONFIG_LISTEN_RANGE_YELL] = sConfig.GetIntDefault("ListenRange.Yell", 300); - m_configs[CONFIG_BATTLEGROUND_CAST_DESERTER] = sConfig.GetBoolDefault("Battleground.CastDeserter", true); m_configs[CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE] = sConfig.GetBoolDefault("Battleground.QueueAnnouncer.Enable", false); m_configs[CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_PLAYERONLY] = sConfig.GetBoolDefault("Battleground.QueueAnnouncer.PlayerOnly", false); diff --git a/src/game/World.h b/src/game/World.h index 170fc2a7a21..aef1cde7f39 100644 --- a/src/game/World.h +++ b/src/game/World.h @@ -91,9 +91,6 @@ enum WorldConfigs CONFIG_INTERVAL_CHANGEWEATHER, CONFIG_PORT_WORLD, CONFIG_SOCKET_SELECTTIME, - CONFIG_GROUP_XP_DISTANCE, - CONFIG_SIGHT_MONSTER, - CONFIG_SIGHT_GUARDER, CONFIG_GAME_TYPE, CONFIG_REALM_ZONE, CONFIG_ALLOW_TWO_SIDE_ACCOUNTS, @@ -166,8 +163,6 @@ enum WorldConfigs CONFIG_CHATFLOOD_MESSAGE_DELAY, CONFIG_CHATFLOOD_MUTE_TIME, CONFIG_EVENT_ANNOUNCE, - CONFIG_CREATURE_FAMILY_FLEE_ASSISTANCE_RADIUS, - CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS, CONFIG_CREATURE_FAMILY_ASSISTANCE_DELAY, CONFIG_CREATURE_FAMILY_FLEE_DELAY, CONFIG_WORLD_BOSS_LEVEL_DIFF, @@ -195,9 +190,6 @@ enum WorldConfigs CONFIG_INSTANT_LOGOUT, CONFIG_ALL_TAXI_PATHS, CONFIG_DECLINED_NAMES_USED, - CONFIG_LISTEN_RANGE_SAY, - CONFIG_LISTEN_RANGE_TEXTEMOTE, - CONFIG_LISTEN_RANGE_YELL, CONFIG_SKILL_MILLING, CONFIG_BATTLEGROUND_CAST_DESERTER, CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE, @@ -285,6 +277,16 @@ enum Rates RATE_DURABILITY_LOSS_PARRY, RATE_DURABILITY_LOSS_ABSORB, RATE_DURABILITY_LOSS_BLOCK, + //{ TODO: store float config values (not only rates), need rename to more generic name + RATE_SIGHT_GUARDER, + RATE_SIGHT_MONSTER, + RATE_LISTEN_RANGE_SAY, + RATE_LISTEN_RANGE_YELL, + RATE_LISTEN_RANGE_TEXTEMOTE, + RATE_CREATURE_FAMILY_FLEE_ASSISTANCE_RADIUS, + RATE_CREATURE_FAMILY_ASSISTANCE_RADIUS, + RATE_GROUP_XP_DISTANCE, + //} MAX_RATES }; @@ -472,20 +474,9 @@ class World float getRate(Rates rate) const { return rate_values[rate]; } /// Set a server configuration element (see #WorldConfigs) - void setConfig(uint32 index,uint32 value) - { - if(indexrandExc (100.0); } +float rand_chance_f(void) +{ + return (float)mtRand->randExc (100.0); +} + Tokens StrSplit(const std::string &src, const std::string &sep) { Tokens r; diff --git a/src/shared/Util.h b/src/shared/Util.h index dfa61e28a94..5d4403fd1b6 100644 --- a/src/shared/Util.h +++ b/src/shared/Util.h @@ -62,6 +62,8 @@ MANGOS_DLL_SPEC float rand_norm_f(void); * With an FPU, there is usually no difference in performance between float and double. */ MANGOS_DLL_SPEC double rand_chance(void); +MANGOS_DLL_SPEC float rand_chance_f(void); + /* Return true if a random roll fits in the specified chance (range 0-100). */ inline bool roll_chance_f(float chance) { diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index ee7bab0d97d..ab3e9106aaf 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "9385" + #define REVISION_NR "9386" #endif // __REVISION_NR_H__