diff --git a/src/game/BattleGround/BattleGround.cpp b/src/game/BattleGround/BattleGround.cpp index c5b25ea01..351d1182d 100644 --- a/src/game/BattleGround/BattleGround.cpp +++ b/src/game/BattleGround/BattleGround.cpp @@ -657,24 +657,54 @@ void BattleGround::EndBattleGround(Team winner) { this->RemoveFromBGFreeSlotQueue(); - ArenaTeam* winner_arena_team = NULL; - ArenaTeam* loser_arena_team = NULL; + ArenaTeam* winner_arena_team = nullptr; + ArenaTeam* loser_arena_team = nullptr; uint32 loser_rating = 0; uint32 winner_rating = 0; WorldPacket data; int32 winmsg_id = 0; + uint32 bgScoresWinner = TEAM_INDEX_NEUTRAL; + uint64 battleground_id = 1; + if (winner == ALLIANCE) { winmsg_id = isBattleGround() ? LANG_BG_A_WINS : LANG_ARENA_GOLD_WINS; + PlaySoundToAll(SOUND_ALLIANCE_WINS); - PlaySoundToAll(SOUND_ALLIANCE_WINS); // alliance wins sound + // reversed index for the bg score storage system + bgScoresWinner = TEAM_INDEX_HORDE; } else if (winner == HORDE) { winmsg_id = isBattleGround() ? LANG_BG_H_WINS : LANG_ARENA_GREEN_WINS; + PlaySoundToAll(SOUND_HORDE_WINS); - PlaySoundToAll(SOUND_HORDE_WINS); // horde wins sound + // reversed index for the bg score storage system + bgScoresWinner = TEAM_INDEX_ALLIANCE; + } + + // store battleground scores + if (isBattleGround() && sWorld.getConfig(CONFIG_BOOL_BATTLEGROUND_SCORE_STATISTICS)) + { + static SqlStatementID insPvPstatsBattleground; + QueryResult* result; + + SqlStatement stmt = CharacterDatabase.CreateStatement(insPvPstatsBattleground, "INSERT INTO pvpstats_battlegrounds (id, winner_team, bracket_id, type, date) VALUES (?, ?, ?, ?, NOW())"); + + uint8 battleground_bracket = GetMinLevel() / 10; + uint8 battleground_type = (uint8)GetTypeID(); + + // query next id + result = CharacterDatabase.Query("SELECT MAX(id) FROM pvpstats_battlegrounds"); + if (result) + { + Field* fields = result->Fetch(); + battleground_id = fields[0].GetUInt64() + 1; + delete result; + } + + stmt.PExecute(battleground_id, bgScoresWinner, battleground_bracket, battleground_type); } SetWinner(winner); @@ -686,22 +716,30 @@ void BattleGround::EndBattleGround(Team winner) // arena rating calculation if (isArena() && isRated()) { - winner_arena_team = sObjectMgr.GetArenaTeamById(GetArenaTeamIdForTeam(winner)); - loser_arena_team = sObjectMgr.GetArenaTeamById(GetArenaTeamIdForTeam(GetOtherTeam(winner))); - if (winner_arena_team && loser_arena_team) + if (winner != TEAM_NONE) { - loser_rating = loser_arena_team->GetStats().rating; - winner_rating = winner_arena_team->GetStats().rating; - int32 winner_change = winner_arena_team->WonAgainst(loser_rating); - int32 loser_change = loser_arena_team->LostAgainst(winner_rating); - DEBUG_LOG("--- Winner rating: %u, Loser rating: %u, Winner change: %i, Loser change: %i ---", winner_rating, loser_rating, winner_change, loser_change); - SetArenaTeamRatingChangeForTeam(winner, winner_change); - SetArenaTeamRatingChangeForTeam(GetOtherTeam(winner), loser_change); + winner_arena_team = sObjectMgr.GetArenaTeamById(GetArenaTeamIdForTeam(winner)); + loser_arena_team = sObjectMgr.GetArenaTeamById(GetArenaTeamIdForTeam(GetOtherTeam(winner))); + if (winner_arena_team && loser_arena_team) + { + loser_rating = loser_arena_team->GetStats().rating; + winner_rating = winner_arena_team->GetStats().rating; + int32 winner_change = winner_arena_team->WonAgainst(loser_rating); + int32 loser_change = loser_arena_team->LostAgainst(winner_rating); + DEBUG_LOG("--- Winner rating: %u, Loser rating: %u, Winner change: %i, Loser change: %i ---", winner_rating, loser_rating, winner_change, loser_change); + SetArenaTeamRatingChangeForTeam(winner, winner_change); + SetArenaTeamRatingChangeForTeam(GetOtherTeam(winner), loser_change); + } + else + { + SetArenaTeamRatingChangeForTeam(ALLIANCE, 0); + SetArenaTeamRatingChangeForTeam(HORDE, 0); + } } else { - SetArenaTeamRatingChangeForTeam(ALLIANCE, 0); - SetArenaTeamRatingChangeForTeam(HORDE, 0); + SetArenaTeamRatingChangeForTeam(ALLIANCE, ARENA_TIMELIMIT_POINTS_LOSS); + SetArenaTeamRatingChangeForTeam(HORDE, ARENA_TIMELIMIT_POINTS_LOSS); } } @@ -776,6 +814,30 @@ void BattleGround::EndBattleGround(Team winner) } } + // store battleground score statistics for each player + if (isBattleGround() && sWorld.getConfig(CONFIG_BOOL_BATTLEGROUND_SCORE_STATISTICS)) + { + static SqlStatementID insPvPstatsPlayer; + BattleGroundScoreMap::iterator score = m_PlayerScores.find(itr->first); + SqlStatement stmt = CharacterDatabase.CreateStatement(insPvPstatsPlayer, "INSERT INTO pvpstats_players (battleground_id, character_guid, score_killing_blows, score_deaths, score_honorable_kills, score_bonus_honor, score_damage_done, score_healing_done, attr_1, attr_2, attr_3, attr_4, attr_5) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"); + + stmt.addUInt32(battleground_id); + stmt.addUInt32(plr->GetGUIDLow()); + stmt.addUInt32(score->second->GetKillingBlows()); + stmt.addUInt32(score->second->GetDeaths()); + stmt.addUInt32(score->second->GetHonorableKills()); + stmt.addUInt32(score->second->GetBonusHonor()); + stmt.addUInt32(score->second->GetDamageDone()); + stmt.addUInt32(score->second->GetHealingDone()); + stmt.addUInt32(score->second->GetAttr1()); + stmt.addUInt32(score->second->GetAttr2()); + stmt.addUInt32(score->second->GetAttr3()); + stmt.addUInt32(score->second->GetAttr4()); + stmt.addUInt32(score->second->GetAttr5()); + + stmt.Execute(); + } + if (team == winner) { RewardMark(plr, ITEM_WINNER_COUNT); @@ -800,9 +862,6 @@ void BattleGround::EndBattleGround(Team winner) if (isArena() && isRated() && winner_arena_team && loser_arena_team) { - // update arena points only after increasing the player's match count! - // obsolete: winner_arena_team->UpdateArenaPointsHelper(); - // obsolete: loser_arena_team->UpdateArenaPointsHelper(); // save the stat changes winner_arena_team->SaveToDB(); loser_arena_team->SaveToDB(); diff --git a/src/game/BattleGround/BattleGround.h b/src/game/BattleGround/BattleGround.h index ecd48432e..31948337a 100644 --- a/src/game/BattleGround/BattleGround.h +++ b/src/game/BattleGround/BattleGround.h @@ -38,6 +38,7 @@ // only arena event // cause this buff apears 90sec after start in every bg i implement it here #define ARENA_BUFF_EVENT 253 +#define ARENA_TIMELIMIT_POINTS_LOSS -16 class Creature; @@ -277,6 +278,19 @@ class BattleGroundScore {} virtual ~BattleGroundScore() {} // virtual destructor is used when deleting score from scores map + uint32 GetKillingBlows() const { return KillingBlows; } + uint32 GetDeaths() const { return Deaths; } + uint32 GetHonorableKills() const { return HonorableKills; } + uint32 GetBonusHonor() const { return BonusHonor; } + uint32 GetDamageDone() const { return DamageDone; } + uint32 GetHealingDone() const { return HealingDone; } + + virtual uint32 GetAttr1() const { return 0; } + virtual uint32 GetAttr2() const { return 0; } + virtual uint32 GetAttr3() const { return 0; } + virtual uint32 GetAttr4() const { return 0; } + virtual uint32 GetAttr5() const { return 0; } + uint32 KillingBlows; uint32 Deaths; uint32 HonorableKills; diff --git a/src/game/Object/Creature.h b/src/game/Object/Creature.h index f40b3ef44..292b8c5da 100644 --- a/src/game/Object/Creature.h +++ b/src/game/Object/Creature.h @@ -97,7 +97,7 @@ struct CreatureInfo uint32 CreatureType; // enum CreatureType values uint32 InhabitType; uint32 RegenerateStats; - bool RacialLeader; + int32 RacialLeader; uint32 NpcFlags; uint32 UnitFlags; // enum UnitFlags mask values uint32 UnitFlags2; // enum UnitFlags2 mask values @@ -192,117 +192,6 @@ struct CreatureInfo } }; - -// from `creature_template` table -/* -struct CreatureInfo -{ - uint32 Entry; - uint32 DifficultyEntry[MAX_DIFFICULTY - 1]; - uint32 KillCredit[MAX_KILL_CREDIT]; - uint32 ModelId[MAX_CREATURE_MODEL]; - char* Name; - char* SubName; - char* IconName; - uint32 GossipMenuId; - uint32 MinLevel; - uint32 MaxLevel; - uint32 MinLevelHealth; - uint32 maxhealth; - uint32 MinLevelMana; - uint32 maxmana; - uint32 armor; - uint32 FactionAlliance; - uint32 FactionHorde; - uint32 NpcFlags; - float speed_walk; - float speed_run; - float Scale; - uint32 Rank; - float mindmg; - float maxdmg; - uint32 dmgschool; - uint32 attackpower; - float dmg_multiplier; - uint32 MeleeAttackPower; - uint32 RangedAttackPower; - uint32 UnitClass; // enum Classes. Note only 4 classes are known for creatures. - uint32 UnitFlags; // enum UnitFlags mask values - uint32 UnitFlags2; // enum UnitFlags2 mask values - uint32 dynamicflags; - uint32 family; // enum CreatureFamily values (optional) - uint32 TrainerType; - uint32 trainer_spell; - uint32 TrainerClass; - uint32 trainer_race; - float minrangedmg; - float maxrangedmg; - uint32 rangedattackpower; - uint32 type; // enum CreatureType values - uint32 CreatureTypeFlags; // enum CreatureTypeFlags mask values - uint32 Lootid; - uint32 pickpocketLootId; - uint32 SkinningLootId; - int32 resistance1; - int32 resistance2; - int32 resistance3; - int32 resistance4; - int32 resistance5; - int32 resistance6; - uint32 PetSpellDataId; - uint32 MinLootGold; - uint32 maxgold; - char const* AIName; - uint32 MovementType; - uint32 InhabitType; - float healthModifier; - float powerModifier; - bool RacialLeader; - uint32 questItems[6]; - uint32 movementId; - bool RegenHealth; - uint32 VehicleTemplateId; - uint32 EquipmentTemplateId; - uint32 TrainerTemplateId; - uint32 VendorTemplateId; - uint32 MechanicImmuneMask; - uint32 ExtraFlags; - - // helpers - HighGuid GetHighGuid() const - { - return VehicleTemplateId ? HIGHGUID_VEHICLE : HIGHGUID_UNIT; - } - - ObjectGuid GetObjectGuid(uint32 lowguid) const { return ObjectGuid(GetHighGuid(), Entry, lowguid); } - - SkillType GetRequiredLootSkill() const - { - if (CreatureTypeFlags & CREATURE_TYPEFLAGS_HERBLOOT) - { return SKILL_HERBALISM; } - else if (CreatureTypeFlags & CREATURE_TYPEFLAGS_MININGLOOT) - { return SKILL_MINING; } - else if (CreatureTypeFlags & CREATURE_TYPEFLAGS_ENGINEERLOOT) - return SKILL_ENGINEERING; - else - { return SKILL_SKINNING; } // normal case - } - - bool IsExotic() const - { - return (CreatureTypeFlags & CREATURE_TYPEFLAGS_EXOTIC); - } - - bool isTameable(bool exotic) const - { - if (type != CREATURE_TYPE_BEAST || family == 0 || (CreatureTypeFlags & CREATURE_TYPEFLAGS_TAMEABLE) == 0) - return false; - - // if can tame exotic then can tame any temable - return exotic || !IsExotic(); - } -}; */ - struct CreatureTemplateSpells { uint32 entry; diff --git a/src/game/Object/ObjectMgr.cpp b/src/game/Object/ObjectMgr.cpp index 565f7a8e5..0eefc5518 100644 --- a/src/game/Object/ObjectMgr.cpp +++ b/src/game/Object/ObjectMgr.cpp @@ -908,10 +908,8 @@ void ObjectMgr::LoadCreatureClassLvlStats() queryStr.append(str.str().c_str()); } - sLog.outErrorDb("Querying creature_template_classlevelstats table"); queryStr.append(" FROM `creature_template_classlevelstats` ORDER BY `Class`, `Level`"); QueryResult* result = WorldDatabase.Query(queryStr.c_str()); - sLog.outErrorDb("Finished querying creature_template_classlevelstats table"); if (!result) { @@ -927,7 +925,6 @@ void ObjectMgr::LoadCreatureClassLvlStats() BarGoLink bar(result->GetRowCount()); uint32 DataCount = 0; - sLog.outErrorDb("Processing rows of creature_template_classlevelstats table"); do { Field* fields = result->Fetch(); @@ -966,7 +963,6 @@ void ObjectMgr::LoadCreatureClassLvlStats() } ++DataCount; } while (result->NextRow()); - sLog.outErrorDb("Finished processing rows of creature_template_classlevelstats table"); delete result; diff --git a/src/game/Object/Player.cpp b/src/game/Object/Player.cpp index 4dea7d30f..34227e026 100644 --- a/src/game/Object/Player.cpp +++ b/src/game/Object/Player.cpp @@ -4545,7 +4545,7 @@ void Player::SetRoot(bool enable) { WorldPacket data; BuildForceMoveRootPacket(&data, enable, 0); - GetSession()->SendPacket(&data); + SendMessageToSet(&data, true); } void Player::SetWaterWalk(bool enable) diff --git a/src/game/Server/DBCStructure.h b/src/game/Server/DBCStructure.h index f1b21ff87..a57e29668 100644 --- a/src/game/Server/DBCStructure.h +++ b/src/game/Server/DBCStructure.h @@ -1841,7 +1841,7 @@ struct SpellEffectEntry uint32 EffectImplicitTargetB; // 23 m_implicitTargetB uint32 EffectSpellId; // 24 m_spellId - spell.dbc uint32 EffectIndex; // 25 m_spellEffectIdx - //uint32 unk; // 26 4.2.0 only 0 or 1 + // uint32 unk; // 26 4.2.0 only 0 or 1 // helpers int32 CalculateSimpleValue() const { return EffectBasePoints; } diff --git a/src/game/Server/DBCfmt.h b/src/game/Server/DBCfmt.h index c17cb27c6..7c0d0983b 100644 --- a/src/game/Server/DBCfmt.h +++ b/src/game/Server/DBCfmt.h @@ -35,6 +35,7 @@ const char AuctionHouseEntryfmt[]="niiix"; const char BankBagSlotPricesEntryfmt[] = "ni"; const char BarberShopStyleEntryfmt[]="nixxxiii"; const char BattlemasterListEntryfmt[]="niiiiiiiiixsiiiiiiii"; +// 1 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 const char CharStartOutfitEntryfmt[]="diiiiiiiiiiiiiiiiiiiiiiiiixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; const char CharTitlesEntryfmt[]="nxsxix"; const char ChatChannelsEntryfmt[]="iixsx"; @@ -117,6 +118,7 @@ const char SoundEntriesfmt[]="nissssssssssssssssssssssxxxxxxxxxxx"; const char SpellCastTimefmt[]="niii"; const char SpellDurationfmt[] = "niii"; const char SpellDifficultyfmt[] = "niiii"; +// 1 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 const char SpellEntryfmt[]="niiiiiiiiiiiiiiifiiiissxxiixxixiiiiiiixiiiiiiiix"; const char SpellAuraOptionsEntryfmt[]="diiii"; const char SpellAuraRestrictionsEntryfmt[]="diiiiiiii"; @@ -124,6 +126,7 @@ const char SpellCastingRequirementsEntryfmt[]="dixxixi"; const char SpellCategoriesEntryfmt[]="diiiiii"; const char SpellClassOptionsEntryfmt[]="dxiiiix"; const char SpellCooldownsEntryfmt[]="diii"; +// 1 10 20 30 const char SpellEffectEntryfmt[]="difiiiffiiiiiifiifiiiiiiiix"; const char SpellEquippedItemsEntryfmt[]="diii"; const char SpellInterruptsEntryfmt[]="dixixi"; @@ -152,6 +155,7 @@ const char TaxiPathNodeEntryfmt[] = "diiifffiiii"; const char TotemCategoryEntryfmt[]="nxii"; const char TransportAnimationEntryfmt[]="diixxxx"; const char VehicleEntryfmt[]="niffffiiiiiiiifffffffffffffffssssfifiixx"; +// 1 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 const char VehicleSeatEntryfmt[]="niiffffffffffiiiiiifffffffiiifffiiiiiiiffiiiiixxxxxxxxxxxxxxxxxxxx"; const char WMOAreaTableEntryfmt[]="niiixxxxxiixxxx"; const char WorldMapAreaEntryfmt[]="xinxffffixxxxx"; diff --git a/src/game/Server/Opcodes.cpp b/src/game/Server/Opcodes.cpp index aa8b63669..9f0009000 100644 --- a/src/game/Server/Opcodes.cpp +++ b/src/game/Server/Opcodes.cpp @@ -131,7 +131,7 @@ void InitializeOpcodes() OPCODE(SMSG_LOGOUT_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); OPCODE(CMSG_LOGOUT_CANCEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLogoutCancelOpcode ); OPCODE(SMSG_LOGOUT_CANCEL_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - OPCODE(CMSG_NAME_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleNameQueryOpcode ); + OPCODE(CMSG_NAME_QUERY, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleNameQueryOpcode ); OPCODE(SMSG_NAME_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); OPCODE(CMSG_PET_NAME_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetNameQueryOpcode ); OPCODE(SMSG_PET_NAME_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/game/Server/SQLStorages.cpp b/src/game/Server/SQLStorages.cpp index 4c2563488..333505f32 100644 --- a/src/game/Server/SQLStorages.cpp +++ b/src/game/Server/SQLStorages.cpp @@ -45,8 +45,8 @@ // // 1 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 -const char CreatureInfosrcfmt[] = "isssiiiiiiiiiiifiiiiiiiiiiffiiiffffffiiiiffffiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiis"; -const char CreatureInfodstfmt[] = "isssiiiiiiiiiiifiiiiiiiiiiffiiiffffffiiiiffffiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiis"; +const char CreatureInfosrcfmt[] = "isssiiiiiiiiiiifiiiiiiiiiiiffiiiffffffiiiiffffiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiis"; +const char CreatureInfodstfmt[] = "isssiiiiiiiiiiifiiiiiiiiiiiffiiiffffffiiiiffffiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiis"; const char CreatureDataAddonInfofmt[] = "iiibbiis"; const char CreatureModelfmt[] = "iffbii"; const char CreatureInfoAddonInfofmt[] = "iiibbiis"; diff --git a/src/game/WorldHandlers/SpellEffects.cpp b/src/game/WorldHandlers/SpellEffects.cpp index 3251b16ce..9f2960807 100644 --- a/src/game/WorldHandlers/SpellEffects.cpp +++ b/src/game/WorldHandlers/SpellEffects.cpp @@ -4275,15 +4275,24 @@ void Spell::EffectTriggerMissileSpell(SpellEffectEntry const* effect) if (!spellInfo) { - sLog.outError("EffectTriggerMissileSpell of spell %u (eff: %u): triggering unknown spell id %u", - m_spellInfo->Id,effect->EffectIndex,triggered_spell_id); + if (unitTarget) + { + DEBUG_FILTER_LOG(LOG_FILTER_SPELL_CAST, "Spell ScriptStart spellid %u in EffectTriggerMissileSpell", m_spellInfo->Id); + m_caster->GetMap()->ScriptsStart(sSpellScripts, m_spellInfo->Id, m_caster, unitTarget); + } + else + sLog.outError("EffectTriggerMissileSpell of spell %u (eff: %u): triggering unknown spell id %u", + m_spellInfo->Id, effect->EffectIndex, triggered_spell_id); return; } if (m_CastItem) DEBUG_FILTER_LOG(LOG_FILTER_SPELL_CAST, "WORLD: cast Item spellId - %i", spellInfo->Id); - m_caster->CastSpell(m_targets.m_destX, m_targets.m_destY, m_targets.m_destZ, spellInfo, true, m_CastItem, NULL, m_originalCasterGUID, m_spellInfo); + if (m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION) + m_caster->CastSpell(m_targets.m_destX, m_targets.m_destY, m_targets.m_destZ, spellInfo, true, m_CastItem, nullptr, m_originalCasterGUID, m_spellInfo); + else if (unitTarget) + m_caster->CastSpell(unitTarget, spellInfo, true, m_CastItem, nullptr, m_originalCasterGUID, m_spellInfo); } void Spell::EffectJump(SpellEffectEntry const* effect) @@ -11535,10 +11544,7 @@ void Spell::EffectPlayMusic(SpellEffectEntry const* effect) return; } - WorldPacket data(SMSG_PLAY_MUSIC, 4); - data << uint32(soundId); - data << ObjectGuid(); - ((Player*)unitTarget)->GetSession()->SendPacket(&data); + m_caster->PlayMusic(soundId, (Player*)unitTarget); } void Spell::EffectSpecCount(SpellEffectEntry const* /*effect*/) diff --git a/src/game/WorldHandlers/World.cpp b/src/game/WorldHandlers/World.cpp index ab93c1de7..6878efc43 100644 --- a/src/game/WorldHandlers/World.cpp +++ b/src/game/WorldHandlers/World.cpp @@ -1029,6 +1029,7 @@ void World::SetInitialWorldSettings() CharacterDatabase.PExecute("DELETE FROM corpse WHERE corpse_type = '0' OR time < (UNIX_TIMESTAMP()-'%u')", 3 * DAY); ///- Load the DBC and DB2 files + sLog.outString("Initialize data stores..."); LoadDBCStores(m_dataPath); DetectDBCLang(); @@ -1127,7 +1128,7 @@ void World::SetInitialWorldSettings() sLog.outString("Loading Creature Stats..."); sObjectMgr.LoadCreatureClassLvlStats(); - sLog.outString("Loading Creature templates..."); + sLog.outErrorDb("Loading Creature templates..."); sObjectMgr.LoadCreatureTemplates(); sLog.outString("Loading Creature template spells..."); @@ -1519,6 +1520,11 @@ void World::SetInitialWorldSettings() uint32 nextGameEvent = sGameEventMgr.Initialize(); m_timers[WUPDATE_EVENTS].SetInterval(nextGameEvent); // depend on next event + // ToDo: requires fix after the latest updates + //sLog.outString("Loading grids for active creatures or transports..."); + //sObjectMgr.LoadActiveEntities(nullptr); + //sLog.outString(); + // Delete all characters which have been deleted X days before Player::DeleteOldCharacters(); diff --git a/src/game/WorldHandlers/World.h b/src/game/WorldHandlers/World.h index 189193835..482809add 100644 --- a/src/game/WorldHandlers/World.h +++ b/src/game/WorldHandlers/World.h @@ -366,6 +366,7 @@ enum eConfigBoolValues CONFIG_BOOL_SKILL_FAIL_POSSIBLE_FISHINGPOOL, CONFIG_BOOL_BATTLEGROUND_CAST_DESERTER, CONFIG_BOOL_BATTLEGROUND_QUEUE_ANNOUNCER_START, + CONFIG_BOOL_BATTLEGROUND_SCORE_STATISTICS, CONFIG_BOOL_ARENA_AUTO_DISTRIBUTE_POINTS, CONFIG_BOOL_ARENA_QUEUE_ANNOUNCER_JOIN, CONFIG_BOOL_ARENA_QUEUE_ANNOUNCER_EXIT, diff --git a/src/shared/DataStores/DBCFileLoader.h b/src/shared/DataStores/DBCFileLoader.h index 6d12be92b..ecb9a112b 100755 --- a/src/shared/DataStores/DBCFileLoader.h +++ b/src/shared/DataStores/DBCFileLoader.h @@ -201,9 +201,9 @@ class DBCFileLoader char* AutoProduceStringsArrayHolders(const char* fmt, char* dataTable); char* AutoProduceStrings(const char* fmt, char* dataTable, LocaleConstant loc); /** - * @brief This works out the total amount of memory required by the types specified within the format string + * Calculate and return the total amount of memory required by the types specified within the format string * - * @param format + * @param format the format string passed to it (see DBCfmt.h) * @param index_pos * @return uint32 the total amount of memory required for all the data types */ diff --git a/src/shared/Database/SQLStorageImpl.h b/src/shared/Database/SQLStorageImpl.h index 29cc7c1b3..6b00c9f6e 100644 --- a/src/shared/Database/SQLStorageImpl.h +++ b/src/shared/Database/SQLStorageImpl.h @@ -274,6 +274,7 @@ void SQLStorageLoaderBase::Load(StorageClass& store return; } +// sLog.outErrorDb("Total # of fields in database: %u - total # of expected fields %u", result->GetFieldCount(), store.GetSrcFieldCount()); if (store.GetSrcFieldCount() != result->GetFieldCount()) { recordCount = 0; @@ -369,14 +370,16 @@ void SQLStorageLoaderBase::Load(StorageClass& store break; default: assert(false && "unknown format character"); - break; } ++y; } + + // check on the contents of the fields +// sLog.outErrorDb("Entry: %u - InhabitType %u - NPC Flags %u - Unit Flags %u", (*result)[0].GetUInt32(), (*result)[18].GetUInt32(), (*result)[21].GetUInt32(), (*result)[22].GetUInt32()); } while (result->NextRow()); delete result; -} +} #endif diff --git a/src/shared/revision.h b/src/shared/revision.h index ab013079f..c9f5a184a 100644 --- a/src/shared/revision.h +++ b/src/shared/revision.h @@ -37,7 +37,7 @@ #define CHAR_DB_UPDATE_DESCRIPTION "match_client_limits" #define WORLD_DB_VERSION_NR 21 - #define WORLD_DB_STRUCTURE_NR 2 - #define WORLD_DB_CONTENT_NR 1 + #define WORLD_DB_STRUCTURE_NR 1 + #define WORLD_DB_CONTENT_NR 0 #define WORLD_DB_UPDATE_DESCRIPTION "script_binding populated" #endif // __REVISION_H__