mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
[8775] implement all creature difficulties + support bgs with this
former know as heroic_entry we now have 3 of those
which let us chose different creature_templates for different
map-types
normal maps will need a bit more support to use correct
spawnmodes
but for battlegrounds it works already good:
they are divided by levelrange:
0-59 == normal spawn -> spiritguides level 60
60-69 == difficulty=1 -> spritiguides level 70
70-79 == difficulty=2 -> spiritguides level 80
80 == difficulty=3 -> spiritguides level 80
this is needed mostly for alterac valley to get
right creature-templates spawned
and with that all creature->SetLevel hacks could
get removed from alterac valley code
This commit is contained in:
parent
adde82b73c
commit
c50df41b3c
18 changed files with 121 additions and 82 deletions
|
|
@ -24,7 +24,7 @@ CREATE TABLE `db_version` (
|
||||||
`version` varchar(120) default NULL,
|
`version` varchar(120) default NULL,
|
||||||
`creature_ai_version` varchar(120) default NULL,
|
`creature_ai_version` varchar(120) default NULL,
|
||||||
`cache_id` int(10) default '0',
|
`cache_id` int(10) default '0',
|
||||||
`required_8770_01_mangos_quest_template` bit(1) default NULL
|
`required_8775_03_mangos_gameobject` bit(1) default NULL
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes';
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes';
|
||||||
|
|
||||||
--
|
--
|
||||||
|
|
@ -1062,6 +1062,8 @@ DROP TABLE IF EXISTS `creature_template`;
|
||||||
CREATE TABLE `creature_template` (
|
CREATE TABLE `creature_template` (
|
||||||
`entry` mediumint(8) unsigned NOT NULL default '0',
|
`entry` mediumint(8) unsigned NOT NULL default '0',
|
||||||
`difficulty_entry_1` mediumint(8) unsigned NOT NULL default '0',
|
`difficulty_entry_1` mediumint(8) unsigned NOT NULL default '0',
|
||||||
|
`difficulty_entry_2` mediumint(8) unsigned NOT NULL default '0',
|
||||||
|
`difficulty_entry_3` mediumint(8) unsigned NOT NULL default '0',
|
||||||
`KillCredit1` int(11) unsigned NOT NULL default '0',
|
`KillCredit1` int(11) unsigned NOT NULL default '0',
|
||||||
`KillCredit2` int(11) unsigned NOT NULL default '0',
|
`KillCredit2` int(11) unsigned NOT NULL default '0',
|
||||||
`modelid_A` mediumint(8) unsigned NOT NULL default '0',
|
`modelid_A` mediumint(8) unsigned NOT NULL default '0',
|
||||||
|
|
|
||||||
6
sql/updates/8775_01_mangos_creature_template.sql
Normal file
6
sql/updates/8775_01_mangos_creature_template.sql
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
ALTER TABLE db_version CHANGE COLUMN required_8770_01_mangos_quest_template required_8775_01_mangos_creature_template bit;
|
||||||
|
|
||||||
|
ALTER TABLE `creature_template` ADD `difficulty_entry_2` MEDIUMINT(8) unsigned
|
||||||
|
NOT NULL default 0 AFTER `difficulty_entry_1`;
|
||||||
|
ALTER TABLE `creature_template` ADD `difficulty_entry_3` MEDIUMINT(8) unsigned
|
||||||
|
NOT NULL default 0 AFTER `difficulty_entry_2`;
|
||||||
10
sql/updates/8775_02_mangos_creature.sql
Normal file
10
sql/updates/8775_02_mangos_creature.sql
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
ALTER TABLE db_version CHANGE COLUMN required_8775_01_mangos_creature_template required_8775_02_mangos_creature bit;
|
||||||
|
|
||||||
|
-- cause bgs now have different spawnmodes all creatures on those maps must go
|
||||||
|
-- to all spwanmodes.. maybe this isn't valid for all creatures - but i won't
|
||||||
|
-- destroy again all bgs :p
|
||||||
|
-- 0x1 = 2^0 - normal
|
||||||
|
-- 0x2 = 2^1 - difficulty_1
|
||||||
|
-- 0x4 = 2^2 - difficulty_2
|
||||||
|
-- 0x8 = 2^3 - difficulty_3
|
||||||
|
UPDATE creature SET spawnMask = (0x1 | 0x2 | 0x4 | 0x8) WHERE map IN (30, 489, 529, 566);
|
||||||
6
sql/updates/8775_03_mangos_gameobject.sql
Normal file
6
sql/updates/8775_03_mangos_gameobject.sql
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
ALTER TABLE db_version CHANGE COLUMN required_8775_02_mangos_creature required_8775_03_mangos_gameobject bit;
|
||||||
|
|
||||||
|
-- cause bgs now have different spawnmodes all gameobjects on those maps must go
|
||||||
|
-- to all spwanmodes.. maybe this isn't valid for all gameobjects - but i won't
|
||||||
|
-- destroy again all bgs :p
|
||||||
|
UPDATE gameobject SET spawnMask = (0x1 | 0x2 | 0x4 | 0x8) WHERE map IN (30, 489, 529, 566);
|
||||||
|
|
@ -148,6 +148,9 @@ pkgdata_DATA = \
|
||||||
8749_01_mangos_mail_loot_template.sql \
|
8749_01_mangos_mail_loot_template.sql \
|
||||||
8769_01_mangos_mail_level_reward.sql \
|
8769_01_mangos_mail_level_reward.sql \
|
||||||
8770_01_mangos_quest_template.sql \
|
8770_01_mangos_quest_template.sql \
|
||||||
|
8775_01_mangos_creature_template.sql \
|
||||||
|
8775_02_mangos_creature.sql \
|
||||||
|
8775_03_mangos_gameobject.sql \
|
||||||
README
|
README
|
||||||
|
|
||||||
## Additional files to include when running 'make dist'
|
## Additional files to include when running 'make dist'
|
||||||
|
|
@ -276,4 +279,7 @@ EXTRA_DIST = \
|
||||||
8749_01_mangos_mail_loot_template.sql \
|
8749_01_mangos_mail_loot_template.sql \
|
||||||
8769_01_mangos_mail_level_reward.sql \
|
8769_01_mangos_mail_level_reward.sql \
|
||||||
8770_01_mangos_quest_template.sql \
|
8770_01_mangos_quest_template.sql \
|
||||||
|
8775_01_mangos_creature_template.sql \
|
||||||
|
8775_02_mangos_creature.sql \
|
||||||
|
8775_03_mangos_gameobject.sql \
|
||||||
README
|
README
|
||||||
|
|
|
||||||
|
|
@ -492,11 +492,10 @@ class BattleGround
|
||||||
// can be extended in in BG subclass
|
// can be extended in in BG subclass
|
||||||
|
|
||||||
/* event related */
|
/* event related */
|
||||||
// generic implementation in BattleGround-class
|
|
||||||
// called when a creature gets added to map (NOTE: only triggered if
|
// called when a creature gets added to map (NOTE: only triggered if
|
||||||
// a player activates the cell of the creature)
|
// a player activates the cell of the creature)
|
||||||
virtual void OnObjectDBLoad(Creature* /*creature*/);
|
void OnObjectDBLoad(Creature* /*creature*/);
|
||||||
virtual void OnObjectDBLoad(GameObject* /*obj*/);
|
void OnObjectDBLoad(GameObject* /*obj*/);
|
||||||
// (de-)spawns creatures and gameobjects from an event
|
// (de-)spawns creatures and gameobjects from an event
|
||||||
void SpawnEvent(uint8 event1, uint8 event2, bool spawn);
|
void SpawnEvent(uint8 event1, uint8 event2, bool spawn);
|
||||||
bool IsActiveEvent(uint8 event1, uint8 event2)
|
bool IsActiveEvent(uint8 event1, uint8 event2)
|
||||||
|
|
@ -510,9 +509,6 @@ class BattleGround
|
||||||
void OpenDoorEvent(uint8 event1, uint8 event2 = 0);
|
void OpenDoorEvent(uint8 event1, uint8 event2 = 0);
|
||||||
bool IsDoor(uint8 event1, uint8 event2);
|
bool IsDoor(uint8 event1, uint8 event2);
|
||||||
|
|
||||||
/* other things */
|
|
||||||
virtual void OnCreatureRespawn(Creature* /*creature*/) {}
|
|
||||||
|
|
||||||
void HandleTriggerBuff(uint64 const& go_guid);
|
void HandleTriggerBuff(uint64 const& go_guid);
|
||||||
|
|
||||||
// TODO: make this protected:
|
// TODO: make this protected:
|
||||||
|
|
|
||||||
|
|
@ -232,23 +232,6 @@ void BattleGroundAV::UpdateScore(BattleGroundTeamId team, int32 points )
|
||||||
UpdateWorldState(((team == BG_TEAM_HORDE) ? BG_AV_Horde_Score : BG_AV_Alliance_Score), m_TeamScores[team]);
|
UpdateWorldState(((team == BG_TEAM_HORDE) ? BG_AV_Horde_Score : BG_AV_Alliance_Score), m_TeamScores[team]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BattleGroundAV::OnObjectDBLoad(Creature* creature)
|
|
||||||
{
|
|
||||||
uint32 level = creature->getLevel();
|
|
||||||
if (level != 0)
|
|
||||||
level += GetMaxLevel() - 60; // maybe we can do this more generic for custom level - range.. actually it's ok
|
|
||||||
creature->SetLevel(level);
|
|
||||||
BattleGround::OnObjectDBLoad(creature);
|
|
||||||
}
|
|
||||||
|
|
||||||
void BattleGroundAV::OnCreatureRespawn(Creature* creature)
|
|
||||||
{
|
|
||||||
uint32 level = creature->getLevel();
|
|
||||||
if (level != 0)
|
|
||||||
level += GetMaxLevel() - 60; // maybe we can do this more generic for custom level - range.. actually it's ok
|
|
||||||
creature->SetLevel(level);
|
|
||||||
}
|
|
||||||
|
|
||||||
void BattleGroundAV::Update(uint32 diff)
|
void BattleGroundAV::Update(uint32 diff)
|
||||||
{
|
{
|
||||||
BattleGround::Update(diff);
|
BattleGround::Update(diff);
|
||||||
|
|
|
||||||
|
|
@ -308,8 +308,6 @@ class BattleGroundAV : public BattleGround
|
||||||
|
|
||||||
/* inherited from BattlegroundClass */
|
/* inherited from BattlegroundClass */
|
||||||
virtual void AddPlayer(Player *plr);
|
virtual void AddPlayer(Player *plr);
|
||||||
virtual void OnObjectDBLoad(Creature* creature);
|
|
||||||
virtual void OnCreatureRespawn(Creature* creature);
|
|
||||||
|
|
||||||
virtual void StartingEventCloseDoors();
|
virtual void StartingEventCloseDoors();
|
||||||
virtual void StartingEventOpenDoors();
|
virtual void StartingEventOpenDoors();
|
||||||
|
|
|
||||||
|
|
@ -191,17 +191,21 @@ bool Creature::InitEntry(uint32 Entry, uint32 team, const CreatureData *data )
|
||||||
// get difficulty 1 mode entry
|
// get difficulty 1 mode entry
|
||||||
uint32 actualEntry = Entry;
|
uint32 actualEntry = Entry;
|
||||||
CreatureInfo const *cinfo = normalInfo;
|
CreatureInfo const *cinfo = normalInfo;
|
||||||
if(normalInfo->DifficultyEntry1)
|
// TODO correctly implement spawnmodes for non-bg maps
|
||||||
|
for (uint32 diff = 0; diff < MAX_DIFFICULTY - 1; ++diff)
|
||||||
{
|
{
|
||||||
//we already have valid Map pointer for current creature!
|
if (normalInfo->DifficultyEntry[diff])
|
||||||
//FIXME: spawn modes 2-3 must have own case DifficultyEntryN
|
|
||||||
if(GetMap()->GetSpawnMode() > 0)
|
|
||||||
{
|
{
|
||||||
cinfo = objmgr.GetCreatureTemplate(normalInfo->DifficultyEntry1);
|
// we already have valid Map pointer for current creature!
|
||||||
if(!cinfo)
|
if (GetMap()->GetSpawnMode() > diff)
|
||||||
{
|
{
|
||||||
sLog.outErrorDb("Creature::UpdateEntry creature difficulty 1 entry %u does not exist.", actualEntry);
|
cinfo = objmgr.GetCreatureTemplate(normalInfo->DifficultyEntry[diff]);
|
||||||
return false;
|
if (!cinfo)
|
||||||
|
{
|
||||||
|
// maybe check such things already at startup
|
||||||
|
sLog.outErrorDb("Creature::UpdateEntry creature difficulty %u entry %u does not exist.", diff + 1, actualEntry);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -362,9 +366,6 @@ void Creature::Update(uint32 diff)
|
||||||
else
|
else
|
||||||
setDeathState( JUST_ALIVED );
|
setDeathState( JUST_ALIVED );
|
||||||
|
|
||||||
if (GetMap()->IsBattleGround() && ((BattleGroundMap*)GetMap())->GetBG())
|
|
||||||
((BattleGroundMap*)GetMap())->GetBG()->OnCreatureRespawn(this); // for alterac valley needed to adjust the correct level again
|
|
||||||
|
|
||||||
//Call AI respawn virtual function
|
//Call AI respawn virtual function
|
||||||
i_AI->JustRespawned();
|
i_AI->JustRespawned();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -158,7 +158,7 @@ enum CreatureFlagsExtra
|
||||||
struct CreatureInfo
|
struct CreatureInfo
|
||||||
{
|
{
|
||||||
uint32 Entry;
|
uint32 Entry;
|
||||||
uint32 DifficultyEntry1;
|
uint32 DifficultyEntry[MAX_DIFFICULTY - 1];
|
||||||
uint32 KillCredit[MAX_KILL_CREDIT];
|
uint32 KillCredit[MAX_KILL_CREDIT];
|
||||||
uint32 DisplayID_A[2];
|
uint32 DisplayID_A[2];
|
||||||
uint32 DisplayID_H[2];
|
uint32 DisplayID_H[2];
|
||||||
|
|
|
||||||
|
|
@ -2628,8 +2628,8 @@ uint32 InstanceMap::GetMaxPlayers() const
|
||||||
|
|
||||||
/* ******* Battleground Instance Maps ******* */
|
/* ******* Battleground Instance Maps ******* */
|
||||||
|
|
||||||
BattleGroundMap::BattleGroundMap(uint32 id, time_t expiry, uint32 InstanceId, Map* _parent)
|
BattleGroundMap::BattleGroundMap(uint32 id, time_t expiry, uint32 InstanceId, Map* _parent, uint8 spawnMode)
|
||||||
: Map(id, expiry, InstanceId, DUNGEON_DIFFICULTY_NORMAL, _parent)
|
: Map(id, expiry, InstanceId, spawnMode, _parent)
|
||||||
{
|
{
|
||||||
//lets initialize visibility distance for BG/Arenas
|
//lets initialize visibility distance for BG/Arenas
|
||||||
BattleGroundMap::InitVisibilityDistance();
|
BattleGroundMap::InitVisibilityDistance();
|
||||||
|
|
|
||||||
|
|
@ -612,7 +612,7 @@ class MANGOS_DLL_SPEC InstanceMap : public Map
|
||||||
class MANGOS_DLL_SPEC BattleGroundMap : public Map
|
class MANGOS_DLL_SPEC BattleGroundMap : public Map
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
BattleGroundMap(uint32 id, time_t, uint32 InstanceId, Map* _parent);
|
BattleGroundMap(uint32 id, time_t, uint32 InstanceId, Map* _parent, uint8 spawnMode);
|
||||||
~BattleGroundMap();
|
~BattleGroundMap();
|
||||||
|
|
||||||
bool Add(Player *);
|
bool Add(Player *);
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@
|
||||||
#include "InstanceSaveMgr.h"
|
#include "InstanceSaveMgr.h"
|
||||||
#include "World.h"
|
#include "World.h"
|
||||||
|
|
||||||
MapInstanced::MapInstanced(uint32 id, time_t expiry) : Map(id, expiry, 0, 0)
|
MapInstanced::MapInstanced(uint32 id, time_t expiry) : Map(id, expiry, 0, DUNGEON_DIFFICULTY_NORMAL)
|
||||||
{
|
{
|
||||||
// initialize instanced maps list
|
// initialize instanced maps list
|
||||||
m_InstancedMaps.clear();
|
m_InstancedMaps.clear();
|
||||||
|
|
@ -216,7 +216,9 @@ BattleGroundMap* MapInstanced::CreateBattleGroundMap(uint32 InstanceId, BattleGr
|
||||||
|
|
||||||
sLog.outDebug("MapInstanced::CreateBattleGroundMap: instance:%d for map:%d and bgType:%d created.", InstanceId, GetId(), bg->GetTypeID());
|
sLog.outDebug("MapInstanced::CreateBattleGroundMap: instance:%d for map:%d and bgType:%d created.", InstanceId, GetId(), bg->GetTypeID());
|
||||||
|
|
||||||
BattleGroundMap *map = new BattleGroundMap(GetId(), GetGridExpiry(), InstanceId, this);
|
// 0-59 normal spawn 60-69 difficulty_1, 70-79 difficulty_2, 80 dufficulty_3
|
||||||
|
uint8 spawnMode = (bg->GetQueueId() > QUEUE_ID_MAX_LEVEL_59) ? (bg->GetQueueId() - QUEUE_ID_MAX_LEVEL_59) : 0;
|
||||||
|
BattleGroundMap *map = new BattleGroundMap(GetId(), GetGridExpiry(), InstanceId, this, spawnMode);
|
||||||
ASSERT(map->IsBattleGroundOrArena());
|
ASSERT(map->IsBattleGroundOrArena());
|
||||||
map->SetBG(bg);
|
map->SetBG(bg);
|
||||||
bg->SetBgMap(map);
|
bg->SetBgMap(map);
|
||||||
|
|
|
||||||
|
|
@ -118,7 +118,7 @@ MapManager::_createBaseMap(uint32 id)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m = new Map(id, i_gridCleanUpDelay, 0, 0);
|
m = new Map(id, i_gridCleanUpDelay, 0, DUNGEON_DIFFICULTY_NORMAL);
|
||||||
}
|
}
|
||||||
i_maps[id] = m;
|
i_maps[id] = m;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -473,8 +473,8 @@ void ObjectMgr::LoadCreatureTemplates()
|
||||||
sLog.outString( ">> Loaded %u creature definitions", sCreatureStorage.RecordCount );
|
sLog.outString( ">> Loaded %u creature definitions", sCreatureStorage.RecordCount );
|
||||||
sLog.outString();
|
sLog.outString();
|
||||||
|
|
||||||
std::set<uint32> difficultyEntries1; // already loaded difficulty 1 value in creatures
|
std::set<uint32> difficultyEntries[MAX_DIFFICULTY - 1]; // already loaded difficulty 1 value in creatures
|
||||||
std::set<uint32> hasDifficultyEntries1; // already loaded creatures with difficulty 1 values
|
std::set<uint32> hasDifficultyEntries[MAX_DIFFICULTY - 1]; // already loaded creatures with difficulty 1 values
|
||||||
|
|
||||||
// check data correctness
|
// check data correctness
|
||||||
for(uint32 i = 1; i < sCreatureStorage.MaxEntry; ++i)
|
for(uint32 i = 1; i < sCreatureStorage.MaxEntry; ++i)
|
||||||
|
|
@ -483,84 +483,105 @@ void ObjectMgr::LoadCreatureTemplates()
|
||||||
if (!cInfo)
|
if (!cInfo)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (cInfo->DifficultyEntry1)
|
bool ok = true; // bool to allow continue outside this loop
|
||||||
|
for (uint32 diff = 0; diff < MAX_DIFFICULTY - 1 && ok; ++diff)
|
||||||
{
|
{
|
||||||
CreatureInfo const* difficultyInfo = GetCreatureTemplate(cInfo->DifficultyEntry1);
|
if (!cInfo->DifficultyEntry[diff])
|
||||||
|
continue;
|
||||||
|
ok = false; // will be set to true at the end of this loop again
|
||||||
|
|
||||||
|
CreatureInfo const* difficultyInfo = GetCreatureTemplate(cInfo->DifficultyEntry[diff]);
|
||||||
if (!difficultyInfo)
|
if (!difficultyInfo)
|
||||||
{
|
{
|
||||||
sLog.outErrorDb("Creature (Entry: %u) have `difficulty_entry_1`=%u but creature entry %u not exist.", i, cInfo->DifficultyEntry1, cInfo->DifficultyEntry1);
|
sLog.outErrorDb("Creature (Entry: %u) have `difficulty_entry_%u`=%u but creature entry %u not exist.",
|
||||||
|
i, diff + 1, cInfo->DifficultyEntry[diff], cInfo->DifficultyEntry[diff]);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (difficultyEntries1.find(i)!=difficultyEntries1.end())
|
if (difficultyEntries[diff].find(i) != difficultyEntries[diff].end())
|
||||||
{
|
{
|
||||||
sLog.outErrorDb("Creature (Entry: %u) listed as difficulty 1 but have value in `difficulty_entry_1`.",i);
|
sLog.outErrorDb("Creature (Entry: %u) listed as difficulty %u but have value in `difficulty_entry_1`.", i, diff + 1);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (difficultyEntries1.find(cInfo->DifficultyEntry1)!=difficultyEntries1.end())
|
bool ok2 = true;
|
||||||
|
for (uint32 diff2 = 0; diff2 < MAX_DIFFICULTY - 1 && ok2; ++diff2)
|
||||||
{
|
{
|
||||||
sLog.outErrorDb("Creature (Entry: %u) already listed as difficulty 1 for another entry.",cInfo->DifficultyEntry1);
|
ok2 = false;
|
||||||
continue;
|
if (difficultyEntries[diff2].find(cInfo->DifficultyEntry[diff]) != difficultyEntries[diff2].end())
|
||||||
}
|
{
|
||||||
|
sLog.outErrorDb("Creature (Entry: %u) already listed as difficulty %u for another entry.", cInfo->DifficultyEntry[diff], diff2 + 1);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (hasDifficultyEntries1.find(cInfo->DifficultyEntry1)!=hasDifficultyEntries1.end())
|
if (hasDifficultyEntries[diff2].find(cInfo->DifficultyEntry[diff]) != hasDifficultyEntries[diff2].end())
|
||||||
{
|
{
|
||||||
sLog.outErrorDb("Creature (Entry: %u) have `difficulty_entry_1`=%u but creature entry %u have difficulty 1 entry also.",i,cInfo->DifficultyEntry1,cInfo->DifficultyEntry1);
|
sLog.outErrorDb("Creature (Entry: %u) have `difficulty_entry_%u`=%u but creature entry %u have difficulty %u entry also.",
|
||||||
continue;
|
i, diff + 1, cInfo->DifficultyEntry[diff], cInfo->DifficultyEntry[diff], diff2 + 1);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
ok2 = true;
|
||||||
}
|
}
|
||||||
|
if (!ok2)
|
||||||
|
continue;
|
||||||
|
|
||||||
if (cInfo->unit_class != difficultyInfo->unit_class)
|
if (cInfo->unit_class != difficultyInfo->unit_class)
|
||||||
{
|
{
|
||||||
sLog.outErrorDb("Creature (Entry: %u, class %u) has different `unit_class` in difficulty 1 mode (Entry: %u, class %u).",i, cInfo->unit_class, cInfo->DifficultyEntry1, difficultyInfo->unit_class);
|
sLog.outErrorDb("Creature (Entry: %u, class %u) has different `unit_class` in difficulty %u mode (Entry: %u, class %u).",
|
||||||
|
i, cInfo->unit_class, diff + 1, cInfo->DifficultyEntry[diff], difficultyInfo->unit_class);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cInfo->npcflag != difficultyInfo->npcflag)
|
if (cInfo->npcflag != difficultyInfo->npcflag)
|
||||||
{
|
{
|
||||||
sLog.outErrorDb("Creature (Entry: %u) has different `npcflag` in difficulty 1 mode (Entry: %u).",i,cInfo->DifficultyEntry1);
|
sLog.outErrorDb("Creature (Entry: %u) has different `npcflag` in difficulty %u mode (Entry: %u).", i, diff + 1, cInfo->DifficultyEntry[diff]);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cInfo->trainer_class != difficultyInfo->trainer_class)
|
if (cInfo->trainer_class != difficultyInfo->trainer_class)
|
||||||
{
|
{
|
||||||
sLog.outErrorDb("Creature (Entry: %u) has different `trainer_class` in difficulty 1 mode (Entry: %u).",i,cInfo->DifficultyEntry1);
|
sLog.outErrorDb("Creature (Entry: %u) has different `trainer_class` in difficulty %u mode (Entry: %u).", i, diff + 1, cInfo->DifficultyEntry[diff]);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cInfo->trainer_race != difficultyInfo->trainer_race)
|
if (cInfo->trainer_race != difficultyInfo->trainer_race)
|
||||||
{
|
{
|
||||||
sLog.outErrorDb("Creature (Entry: %u) has different `trainer_race` in difficulty 1 mode (Entry: %u).",i,cInfo->DifficultyEntry1);
|
sLog.outErrorDb("Creature (Entry: %u) has different `trainer_race` in difficulty %u mode (Entry: %u).", i, diff + 1, cInfo->DifficultyEntry[diff]);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cInfo->trainer_type != difficultyInfo->trainer_type)
|
if (cInfo->trainer_type != difficultyInfo->trainer_type)
|
||||||
{
|
{
|
||||||
sLog.outErrorDb("Creature (Entry: %u) has different `trainer_type` in difficulty 1 mode (Entry: %u).",i,cInfo->DifficultyEntry1);
|
sLog.outErrorDb("Creature (Entry: %u) has different `trainer_type` in difficulty %u mode (Entry: %u).", i, diff + 1, cInfo->DifficultyEntry[diff]);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cInfo->trainer_spell != difficultyInfo->trainer_spell)
|
if (cInfo->trainer_spell != difficultyInfo->trainer_spell)
|
||||||
{
|
{
|
||||||
sLog.outErrorDb("Creature (Entry: %u) has different `trainer_spell` in difficulty 1 mode (Entry: %u).",i,cInfo->DifficultyEntry1);
|
sLog.outErrorDb("Creature (Entry: %u) has different `trainer_spell` in difficulty %u mode (Entry: %u).", i, diff + 1, cInfo->DifficultyEntry[diff]);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (difficultyInfo->AIName && *difficultyInfo->AIName)
|
if (difficultyInfo->AIName && *difficultyInfo->AIName)
|
||||||
{
|
{
|
||||||
sLog.outErrorDb("Difficulty 1 mode creature (Entry: %u) has `AIName`, but in any case will used difficulty 0 mode creature (Entry: %u) AIName.",cInfo->DifficultyEntry1,i);
|
sLog.outErrorDb("Difficulty %u mode creature (Entry: %u) has `AIName`, but in any case will used difficulty 0 mode creature (Entry: %u) AIName.",
|
||||||
|
diff, cInfo->DifficultyEntry[diff], i);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (difficultyInfo->ScriptID)
|
if (difficultyInfo->ScriptID)
|
||||||
{
|
{
|
||||||
sLog.outErrorDb("Difficulty 1 mode creature (Entry: %u) has `ScriptName`, but in any case will used difficulty 0 mode creature (Entry: %u) ScriptName.",cInfo->DifficultyEntry1,i);
|
sLog.outErrorDb("Difficulty %u mode creature (Entry: %u) has `ScriptName`, but in any case will used difficulty 0 mode creature (Entry: %u) ScriptName.",
|
||||||
|
diff, cInfo->DifficultyEntry[diff], i);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
hasDifficultyEntries1.insert(i);
|
hasDifficultyEntries[diff].insert(i);
|
||||||
difficultyEntries1.insert(cInfo->DifficultyEntry1);
|
difficultyEntries[diff].insert(cInfo->DifficultyEntry[diff]);
|
||||||
|
ok = true;
|
||||||
}
|
}
|
||||||
|
if (!ok)
|
||||||
|
continue;
|
||||||
|
|
||||||
FactionTemplateEntry const* factionTemplate = sFactionTemplateStore.LookupEntry(cInfo->faction_A);
|
FactionTemplateEntry const* factionTemplate = sFactionTemplateStore.LookupEntry(cInfo->faction_A);
|
||||||
if (!factionTemplate)
|
if (!factionTemplate)
|
||||||
|
|
@ -1032,11 +1053,12 @@ void ObjectMgr::LoadCreatures()
|
||||||
}
|
}
|
||||||
|
|
||||||
// build single time for check creature data
|
// build single time for check creature data
|
||||||
std::set<uint32> difficultyCreatures1;
|
std::set<uint32> difficultyCreatures[MAX_DIFFICULTY - 1];
|
||||||
for(uint32 i = 0; i < sCreatureStorage.MaxEntry; ++i)
|
for (uint32 i = 0; i < sCreatureStorage.MaxEntry; ++i)
|
||||||
if(CreatureInfo const* cInfo = sCreatureStorage.LookupEntry<CreatureInfo>(i))
|
if (CreatureInfo const* cInfo = sCreatureStorage.LookupEntry<CreatureInfo>(i))
|
||||||
if(cInfo->DifficultyEntry1)
|
for (uint32 diff = 0; diff < MAX_DIFFICULTY - 1; ++diff)
|
||||||
difficultyCreatures1.insert(cInfo->DifficultyEntry1);
|
if (cInfo->DifficultyEntry[diff])
|
||||||
|
difficultyCreatures[diff].insert(cInfo->DifficultyEntry[diff]);
|
||||||
|
|
||||||
// build single time for check spawnmask
|
// build single time for check spawnmask
|
||||||
std::map<uint32,uint32> spawnMasks;
|
std::map<uint32,uint32> spawnMasks;
|
||||||
|
|
@ -1095,11 +1117,18 @@ void ObjectMgr::LoadCreatures()
|
||||||
if (data.spawnMask & ~spawnMasks[data.mapid])
|
if (data.spawnMask & ~spawnMasks[data.mapid])
|
||||||
sLog.outErrorDb("Table `creature` have creature (GUID: %u) that have wrong spawn mask %u including not supported difficulty modes for map (Id: %u).",guid, data.spawnMask, data.mapid );
|
sLog.outErrorDb("Table `creature` have creature (GUID: %u) that have wrong spawn mask %u including not supported difficulty modes for map (Id: %u).",guid, data.spawnMask, data.mapid );
|
||||||
|
|
||||||
if(difficultyCreatures1.find(data.id)!=difficultyCreatures1.end())
|
bool ok = true;
|
||||||
|
for (uint32 diff = 0; diff < MAX_DIFFICULTY - 1 && ok; ++diff)
|
||||||
{
|
{
|
||||||
sLog.outErrorDb("Table `creature` have creature (GUID: %u) that listed as difficulty 1 template (entry: %u) in `creature_template`, skipped.",guid, data.id );
|
if (difficultyCreatures[diff].find(data.id) != difficultyCreatures[diff].end())
|
||||||
continue;
|
{
|
||||||
|
sLog.outErrorDb("Table `creature` have creature (GUID: %u) that listed as difficulty %u template (entry: %u) in `creature_template`, skipped.",
|
||||||
|
guid, diff + 1, data.id );
|
||||||
|
ok = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
if (!ok)
|
||||||
|
continue;
|
||||||
|
|
||||||
if(data.equipmentId > 0) // -1 no equipment, 0 use default
|
if(data.equipmentId > 0) // -1 no equipment, 0 use default
|
||||||
{
|
{
|
||||||
|
|
@ -3191,7 +3220,7 @@ void ObjectMgr::LoadGroups()
|
||||||
uint32 diff = fields[4].GetUInt8();
|
uint32 diff = fields[4].GetUInt8();
|
||||||
if(diff >= (mapEntry->IsRaid() ? MAX_RAID_DIFFICULTY : MAX_DUNGEON_DIFFICULTY))
|
if(diff >= (mapEntry->IsRaid() ? MAX_RAID_DIFFICULTY : MAX_DUNGEON_DIFFICULTY))
|
||||||
{
|
{
|
||||||
sLog.outErrorDb("Wrong dungeon difficulty use in group_instance table: %d", diff);
|
sLog.outErrorDb("Wrong dungeon difficulty use in group_instance table: %d", diff + 1);
|
||||||
diff = 0; // default for both difficaly types
|
diff = 0; // default for both difficaly types
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,8 +25,8 @@ extern DatabasePostgre WorldDatabase;
|
||||||
extern DatabaseMysql WorldDatabase;
|
extern DatabaseMysql WorldDatabase;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const char CreatureInfosrcfmt[]="iiiiiiiisssiiiiiiiiiiffiffiifiiiiiiiiiiffiiiiiiiiiiiiiiiiiiisiiffliiiiiiiliiis";
|
const char CreatureInfosrcfmt[]="iiiiiiiiiisssiiiiiiiiiiffiffiifiiiiiiiiiiffiiiiiiiiiiiiiiiiiiisiiffliiiiiiiliiis";
|
||||||
const char CreatureInfodstfmt[]="iiiiiiiisssiiiiiiiiiiffiffiifiiiiiiiiiiffiiiiiiiiiiiiiiiiiiisiiffliiiiiiiliiii";
|
const char CreatureInfodstfmt[]="iiiiiiiiiisssiiiiiiiiiiffiffiifiiiiiiiiiiffiiiiiiiiiiiiiiiiiiisiiffliiiiiiiliiii";
|
||||||
const char CreatureDataAddonInfofmt[]="iiiiiis";
|
const char CreatureDataAddonInfofmt[]="iiiiiis";
|
||||||
const char CreatureModelfmt[]="iffbi";
|
const char CreatureModelfmt[]="iffbi";
|
||||||
const char CreatureInfoAddonInfofmt[]="iiiiiis";
|
const char CreatureInfoAddonInfofmt[]="iiiiiis";
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "8774"
|
#define REVISION_NR "8775"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
#ifndef __REVISION_SQL_H__
|
#ifndef __REVISION_SQL_H__
|
||||||
#define __REVISION_SQL_H__
|
#define __REVISION_SQL_H__
|
||||||
#define REVISION_DB_CHARACTERS "required_8721_01_characters_guild"
|
#define REVISION_DB_CHARACTERS "required_8721_01_characters_guild"
|
||||||
#define REVISION_DB_MANGOS "required_8770_01_mangos_quest_template"
|
#define REVISION_DB_MANGOS "required_8775_03_mangos_gameobject"
|
||||||
#define REVISION_DB_REALMD "required_8728_01_realmd_account"
|
#define REVISION_DB_REALMD "required_8728_01_realmd_account"
|
||||||
#endif // __REVISION_SQL_H__
|
#endif // __REVISION_SQL_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue