diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Entities/Creature/Creature.cpp | 25 | ||||
-rw-r--r-- | src/server/game/Entities/Creature/Creature.h | 2 | ||||
-rw-r--r-- | src/server/game/Globals/ObjectMgr.cpp | 42 | ||||
-rw-r--r-- | src/server/game/Spells/SpellEffects.cpp | 2 | ||||
-rw-r--r-- | src/server/game/World/World.cpp | 4 | ||||
-rw-r--r-- | src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_maiden_of_grief.cpp | 2 |
6 files changed, 60 insertions, 17 deletions
diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 8019a14a0bd..e4bdc2d58fe 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -391,7 +391,7 @@ bool Creature::UpdateEntry(uint32 Entry, uint32 team, const CreatureData* data) SetAttackTime(OFF_ATTACK, cInfo->baseattacktime); SetAttackTime(RANGED_ATTACK, cInfo->rangeattacktime); - SelectLevel(GetCreatureTemplate()); + SelectLevel(); SetMeleeDamageSchool(SpellSchools(cInfo->dmgschool)); CreatureBaseStats const* stats = sObjectMgr->GetCreatureBaseStats(getLevel(), cInfo->unit_class); @@ -1039,22 +1039,24 @@ void Creature::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask) WorldDatabase.CommitTransaction(trans); } -void Creature::SelectLevel(const CreatureTemplate* cinfo) +void Creature::SelectLevel() { - uint32 rank = IsPet()? 0 : cinfo->rank; + CreatureTemplate const* cInfo = GetCreatureTemplate(); + + uint32 rank = IsPet() ? 0 : cInfo->rank; // level - uint8 minlevel = std::min(cinfo->maxlevel, cinfo->minlevel); - uint8 maxlevel = std::max(cinfo->maxlevel, cinfo->minlevel); + uint8 minlevel = std::min(cInfo->maxlevel, cInfo->minlevel); + uint8 maxlevel = std::max(cInfo->maxlevel, cInfo->minlevel); uint8 level = minlevel == maxlevel ? minlevel : urand(minlevel, maxlevel); SetLevel(level); - CreatureBaseStats const* stats = sObjectMgr->GetCreatureBaseStats(level, cinfo->unit_class); + CreatureBaseStats const* stats = sObjectMgr->GetCreatureBaseStats(level, cInfo->unit_class); // health float healthmod = _GetHealthMod(rank); - uint32 basehp = stats->GenerateHealth(cinfo); + uint32 basehp = stats->GenerateHealth(cInfo); uint32 health = uint32(basehp * healthmod); SetCreateHealth(health); @@ -1063,10 +1065,10 @@ void Creature::SelectLevel(const CreatureTemplate* cinfo) ResetPlayerDamageReq(); // mana - uint32 mana = stats->GenerateMana(cinfo); + uint32 mana = stats->GenerateMana(cInfo); SetCreateMana(mana); - SetMaxPower(POWER_MANA, mana); //MAX Mana + SetMaxPower(POWER_MANA, mana); // MAX Mana SetPower(POWER_MANA, mana); /// @todo set UNIT_FIELD_POWER*, for some creature class case (energy, etc) @@ -1076,7 +1078,7 @@ void Creature::SelectLevel(const CreatureTemplate* cinfo) // damage - float basedamage = stats->GenerateBaseDamage(cinfo); + float basedamage = stats->GenerateBaseDamage(cInfo); float weaponBaseMinDamage = basedamage; float weaponBaseMaxDamage = basedamage * 1.5; @@ -1529,8 +1531,7 @@ void Creature::Respawn(bool force) if (m_originalEntry != GetEntry()) UpdateEntry(m_originalEntry); - CreatureTemplate const* cinfo = GetCreatureTemplate(); - SelectLevel(cinfo); + SelectLevel(); setDeathState(JUST_RESPAWNED); diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index e9abd7c0e0a..737e3072091 100644 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -439,7 +439,7 @@ class Creature : public Unit, public GridObject<Creature>, public MapObject bool Create(uint32 guidlow, Map* map, uint32 phaseMask, uint32 Entry, uint32 vehId, uint32 team, float x, float y, float z, float ang, const CreatureData* data = NULL); bool LoadCreaturesAddon(bool reload = false); - void SelectLevel(const CreatureTemplate* cinfo); + void SelectLevel(); void LoadEquipment(int8 id = 1, bool force = false); uint32 GetDBTableGUIDLow() const { return m_DBTableGuid; } diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 0d6990acb01..04f3395653d 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -638,6 +638,24 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo) if (!ok2) continue; + if (cInfo->expansion > difficultyInfo->expansion) + { + TC_LOG_ERROR("sql.sql", "Creature (Entry: %u, expansion %u) has different `expansion` in difficulty %u mode (Entry: %u, expansion %u).", + cInfo->Entry, cInfo->expansion, diff + 1, cInfo->DifficultyEntry[diff], difficultyInfo->expansion); + } + + if (cInfo->faction_A != difficultyInfo->faction_A) + { + TC_LOG_ERROR("sql.sql", "Creature (Entry: %u, faction_A %u) has different `faction_A` in difficulty %u mode (Entry: %u, faction_A %u).", + cInfo->Entry, cInfo->faction_A, diff + 1, cInfo->DifficultyEntry[diff], difficultyInfo->faction_A); + } + + if (cInfo->faction_H != difficultyInfo->faction_H) + { + TC_LOG_ERROR("sql.sql", "Creature (Entry: %u, faction_H %u) has different `faction_H` in difficulty %u mode (Entry: %u, faction_H %u).", + cInfo->Entry, cInfo->faction_H, diff + 1, cInfo->DifficultyEntry[diff], difficultyInfo->faction_H); + } + if (cInfo->unit_class != difficultyInfo->unit_class) { TC_LOG_ERROR("sql.sql", "Creature (Entry: %u, class %u) has different `unit_class` in difficulty %u mode (Entry: %u, class %u).", @@ -651,6 +669,12 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo) continue; } + if (cInfo->family != difficultyInfo->family) + { + TC_LOG_ERROR("sql.sql", "Creature (Entry: %u, family %u) has different `family` in difficulty %u mode (Entry: %u, family %u).", + cInfo->Entry, cInfo->family, diff + 1, cInfo->DifficultyEntry[diff], difficultyInfo->family); + } + if (cInfo->trainer_class != difficultyInfo->trainer_class) { TC_LOG_ERROR("sql.sql", "Creature (Entry: %u) has different `trainer_class` in difficulty %u mode (Entry: %u).", cInfo->Entry, diff + 1, cInfo->DifficultyEntry[diff]); @@ -675,6 +699,24 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo) continue; } + if (cInfo->type != difficultyInfo->type) + { + TC_LOG_ERROR("sql.sql", "Creature (Entry: %u, type %u) has different `type` in difficulty %u mode (Entry: %u, type %u).", + cInfo->Entry, cInfo->type, diff + 1, cInfo->DifficultyEntry[diff], difficultyInfo->type); + } + + if (cInfo->type_flags != difficultyInfo->type_flags) + { + TC_LOG_ERROR("sql.sql", "Creature (Entry: %u, type_flags %u) has different `type_flags` in difficulty %u mode (Entry: %u, type_flags %u).", + cInfo->Entry, cInfo->type_flags, diff + 1, cInfo->DifficultyEntry[diff], difficultyInfo->type_flags); + } + + if (!cInfo->VehicleId && difficultyInfo->VehicleId) + { + TC_LOG_ERROR("sql.sql", "Creature (Entry: %u, VehicleId %u) has different `VehicleId` in difficulty %u mode (Entry: %u, VehicleId %u).", + cInfo->Entry, cInfo->VehicleId, diff + 1, cInfo->DifficultyEntry[diff], difficultyInfo->VehicleId); + } + if (!difficultyInfo->AIName.empty()) { TC_LOG_ERROR("sql.sql", "Creature (Entry: %u) lists difficulty %u mode entry %u with `AIName` filled in. `AIName` of difficulty 0 mode creature is always used instead.", diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 81eb45191bf..b8e5b3ff742 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -2326,7 +2326,7 @@ void Spell::EffectSummonType(SpellEffIndex effIndex) if (!summon || !summon->HasUnitTypeMask(UNIT_MASK_MINION)) return; - summon->SelectLevel(summon->GetCreatureTemplate()); // some summoned creaters have different from 1 DB data for level/hp + summon->SelectLevel(); // some summoned creaters have different from 1 DB data for level/hp summon->SetUInt32Value(UNIT_NPC_FLAGS, summon->GetCreatureTemplate()->npcflag); summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index c071505e97c..29ee03f31d6 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -947,12 +947,12 @@ void World::LoadConfigSettings(bool reload) if (reload) { - uint32 val = sConfigMgr->GetIntDefault("Expansion", 1); + uint32 val = sConfigMgr->GetIntDefault("Expansion", 2); if (val != m_int_configs[CONFIG_EXPANSION]) TC_LOG_ERROR("server.loading", "Expansion option can't be changed at worldserver.conf reload, using current value (%u).", m_int_configs[CONFIG_EXPANSION]); } else - m_int_configs[CONFIG_EXPANSION] = sConfigMgr->GetIntDefault("Expansion", 1); + m_int_configs[CONFIG_EXPANSION] = sConfigMgr->GetIntDefault("Expansion", 2); m_int_configs[CONFIG_CHATFLOOD_MESSAGE_COUNT] = sConfigMgr->GetIntDefault("ChatFlood.MessageCount", 10); m_int_configs[CONFIG_CHATFLOOD_MESSAGE_DELAY] = sConfigMgr->GetIntDefault("ChatFlood.MessageDelay", 1); diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_maiden_of_grief.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_maiden_of_grief.cpp index 3d032055cb6..927f4490770 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_maiden_of_grief.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_maiden_of_grief.cpp @@ -93,7 +93,7 @@ class boss_maiden_of_grief : public CreatureScript void UpdateAI(uint32 diff) OVERRIDE { if (!UpdateVictim()) - return; + return; events.Update(diff); |