aboutsummaryrefslogtreecommitdiff
path: root/src/server
diff options
context:
space:
mode:
authorKinzcool <kinzzcool@hotmail.com>2014-11-30 03:45:48 -0500
committerKinzcool <kinzzcool@hotmail.com>2014-11-30 03:45:48 -0500
commite3b23c2513a651242d3c04e222ac05aa0330400c (patch)
tree790db0d6e2930be53f11b889f1553e09cfe6176b /src/server
parenta00307ac36937a0a7ce161b56714aa217eb5bfd3 (diff)
Core/Creature: Implemented negative levels for creatures having -1 as expansion
Diffstat (limited to 'src/server')
-rw-r--r--src/server/game/Entities/Creature/Creature.h6
-rw-r--r--src/server/game/Globals/ObjectMgr.cpp37
-rw-r--r--src/server/game/Spells/SpellMgr.cpp2
-rw-r--r--src/server/scripts/Commands/cs_reload.cpp2
-rw-r--r--src/server/worldserver/worldserver.conf.dist2
5 files changed, 29 insertions, 20 deletions
diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h
index 523a2eb2f4d..e9212b50933 100644
--- a/src/server/game/Entities/Creature/Creature.h
+++ b/src/server/game/Entities/Creature/Creature.h
@@ -88,9 +88,9 @@ struct CreatureTemplate
std::string SubName;
std::string IconName;
uint32 GossipMenuId;
- uint8 minlevel;
- uint8 maxlevel;
- uint32 expansion;
+ int16 minlevel;
+ int16 maxlevel;
+ int32 expansion;
uint32 expansionUnknown; // either 0 or 3, sent to the client / wdb
uint32 faction;
uint32 npcflag;
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index ca26a27c4f8..82f7ece4477 100644
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -482,8 +482,8 @@ void ObjectMgr::LoadCreatureTemplate(Field* fields)
creatureTemplate.SubName = fields[12].GetString();
creatureTemplate.IconName = fields[13].GetString();
creatureTemplate.GossipMenuId = fields[14].GetUInt32();
- creatureTemplate.minlevel = fields[15].GetUInt8();
- creatureTemplate.maxlevel = fields[16].GetUInt8();
+ creatureTemplate.minlevel = fields[15].GetInt16();
+ creatureTemplate.maxlevel = fields[16].GetInt16();
creatureTemplate.expansion = uint32(fields[17].GetInt16());
creatureTemplate.expansionUnknown = uint32(fields[18].GetUInt16());
creatureTemplate.faction = uint32(fields[19].GetUInt16());
@@ -674,18 +674,6 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
cInfo->Entry, cInfo->expansion, diff + 1, cInfo->DifficultyEntry[diff], difficultyInfo->expansion);
}
- if (cInfo->minlevel > difficultyInfo->minlevel)
- {
- TC_LOG_ERROR("sql.sql", "Creature (Entry: %u, minlevel %u) has lower `minlevel` in difficulty %u mode (Entry: %u, minlevel %u).",
- cInfo->Entry, cInfo->minlevel, diff + 1, cInfo->DifficultyEntry[diff], difficultyInfo->minlevel);
- }
-
- if (cInfo->maxlevel > difficultyInfo->maxlevel)
- {
- TC_LOG_ERROR("sql.sql", "Creature (Entry: %u, maxlevel %u) has lower `maxlevel` in difficulty %u mode (Entry: %u, maxlevel %u).",
- cInfo->Entry, cInfo->maxlevel, diff + 1, cInfo->DifficultyEntry[diff], difficultyInfo->maxlevel);
- }
-
if (cInfo->faction != difficultyInfo->faction)
{
TC_LOG_ERROR("sql.sql", "Creature (Entry: %u, faction %u) has different `faction` in difficulty %u mode (Entry: %u, faction %u).",
@@ -983,6 +971,27 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
const_cast<CreatureTemplate*>(cInfo)->flags_extra &= CREATURE_FLAG_EXTRA_DB_ALLOWED;
}
+ // -1 is used in the client for auto-updating the levels
+ // having their expansion set to it to the latest one
+ if (cInfo->expansion == -1)
+ {
+ const_cast<CreatureTemplate*>(cInfo)->minlevel = (MAX_LEVEL + cInfo->minlevel);
+ const_cast<CreatureTemplate*>(cInfo)->maxlevel = (MAX_LEVEL + cInfo->maxlevel);
+ const_cast<CreatureTemplate*>(cInfo)->expansion = EXPANSION_WARLORDS_OF_DRAENOR;
+ }
+
+ if (cInfo->minlevel < 1 || cInfo->minlevel > STRONG_MAX_LEVEL)
+ {
+ TC_LOG_ERROR("sql.sql", "Creature (ID: %u): MinLevel %i is not within [1, 255], value has been set to 1.", cInfo->Entry, cInfo->minlevel);
+ const_cast<CreatureTemplate*>(cInfo)->minlevel = 1;
+ }
+
+ if (cInfo->maxlevel < 1 || cInfo->maxlevel > STRONG_MAX_LEVEL)
+ {
+ TC_LOG_ERROR("sql.sql", "Creature (ID: %u): MaxLevel %i is not within [1, 255], value has been set to 1.", cInfo->Entry, cInfo->maxlevel);
+ const_cast<CreatureTemplate*>(cInfo)->maxlevel = 1;
+ }
+
const_cast<CreatureTemplate*>(cInfo)->ModDamage *= Creature::_GetDamageMod(cInfo->rank);
}
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp
index ee92c9347c8..43307ab1a9b 100644
--- a/src/server/game/Spells/SpellMgr.cpp
+++ b/src/server/game/Spells/SpellMgr.cpp
@@ -1672,7 +1672,7 @@ void SpellMgr::LoadSpellTargetPositions()
mSpellTargetPositions.clear(); // need for reload case
- // 0 1 2 3 4 5
+ // 0 1 2 3 4 5
QueryResult result = WorldDatabase.Query("SELECT ID, EffectIndex, MapID, PositionX, PositionY, PositionZ FROM spell_target_position");
if (!result)
{
diff --git a/src/server/scripts/Commands/cs_reload.cpp b/src/server/scripts/Commands/cs_reload.cpp
index fa6adcc8eb0..84e850034a9 100644
--- a/src/server/scripts/Commands/cs_reload.cpp
+++ b/src/server/scripts/Commands/cs_reload.cpp
@@ -954,7 +954,7 @@ public:
sObjectMgr->LoadGraveyardZones();
- handler->SendGlobalGMSysMessage("DB table `game_graveyard_zone` reloaded.");
+ handler->SendGlobalGMSysMessage("DB table `graveyard_zone` reloaded.");
return true;
}
diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist
index 71bc9233f87..36395d4d06e 100644
--- a/src/server/worldserver/worldserver.conf.dist
+++ b/src/server/worldserver/worldserver.conf.dist
@@ -93,7 +93,7 @@ LogsDir = ""
# Default: "127.0.0.1;3306;trinity;trinity;auth" - (LoginDatabaseInfo)
# "127.0.0.1;3306;trinity;trinity;world" - (WorldDatabaseInfo)
# "127.0.0.1;3306;trinity;trinity;characters" - (CharacterDatabaseInfo)
-# "127.0.0.1;3306;trinity;trinity;hotfixes" - (HotfixDatabaseInfo)
+# "127.0.0.1;3306;trinity;trinity;hotfixes" - (HotfixDatabaseInfo)
LoginDatabaseInfo = "127.0.0.1;3306;trinity;trinity;auth"
WorldDatabaseInfo = "127.0.0.1;3306;trinity;trinity;world"