Skip to content

Commit

Permalink
Core/Creature: Add basehp3 to creature_classlevelstats
Browse files Browse the repository at this point in the history
  • Loading branch information
DDuarte committed Aug 6, 2012
1 parent 9795498 commit b72373f
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
7 changes: 7 additions & 0 deletions sql/updates/world/2012_08_06_00_world_classlevelstats.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
ALTER TABLE `creature_classlevelstats` ADD `basehp3` smallint(6) NOT NULL DEFAULT '1' AFTER `basehp2`;

ALTER TABLE `creature_classlevelstats` CHANGE `basehp0` `basehp0` smallint(6) NOT NULL DEFAULT '1';
ALTER TABLE `creature_classlevelstats` CHANGE `basehp1` `basehp1` smallint(6) NOT NULL DEFAULT '1';
ALTER TABLE `creature_classlevelstats` CHANGE `basehp2` `basehp2` smallint(6) NOT NULL DEFAULT '1';
ALTER TABLE `creature_classlevelstats` CHANGE `basemana` `basemana` smallint(6) NOT NULL DEFAULT '1';
ALTER TABLE `creature_classlevelstats` CHANGE `basearmor` `basearmor` smallint(6) NOT NULL DEFAULT '1';
4 changes: 0 additions & 4 deletions src/server/game/Entities/Creature/Creature.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,6 @@ struct CreatureTemplate
// Benchmarked: Faster than std::map (insert/find)
typedef UNORDERED_MAP<uint32, CreatureTemplate> CreatureTemplateContainer;

// Represents max amount of expansions.
// TODO: Update to Cata, if required
#define MAX_CREATURE_BASE_HP MAX_EXPANSION - 1

// Defines base stats for creatures (used to calculate HP/mana/armor).
struct CreatureBaseStats
{
Expand Down
6 changes: 3 additions & 3 deletions src/server/game/Globals/ObjectMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -859,13 +859,13 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
const_cast<CreatureTemplate*>(cInfo)->scale = 1.0f;
}

if (cInfo->expansion > MAX_EXPANSION)
if (cInfo->expansion > MAX_CREATURE_BASE_HP)
{
sLog->outErrorDb("Table `creature_template` lists creature (Entry: %u) with `exp` %u. Ignored and set to 0.", cInfo->Entry, cInfo->expansion);
const_cast<CreatureTemplate*>(cInfo)->expansion = 0;
}

if (cInfo->expansionUnknown > MAX_EXPANSION)
if (cInfo->expansionUnknown > MAX_CREATURE_BASE_HP)
{
sLog->outErrorDb("Table `creature_template` lists creature (Entry: %u) with `exp_unk` %u. Ignored and set to 0.", cInfo->Entry, cInfo->expansionUnknown);
const_cast<CreatureTemplate*>(cInfo)->expansionUnknown = 0;
Expand Down Expand Up @@ -8489,7 +8489,7 @@ void ObjectMgr::LoadCreatureClassLevelStats()
{
uint32 oldMSTime = getMSTime();

QueryResult result = WorldDatabase.Query("SELECT level, class, basehp0, basehp1, basehp2, basemana, basearmor FROM creature_classlevelstats");
QueryResult result = WorldDatabase.Query("SELECT level, class, basehp0, basehp1, basehp2, basehp3, basemana, basearmor FROM creature_classlevelstats");

if (!result)
{
Expand Down
2 changes: 1 addition & 1 deletion src/server/game/Miscellaneous/SharedDefines.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include "Define.h"
#include <cassert>

#define MAX_EXPANSION 4
#define MAX_CREATURE_BASE_HP 4

enum SpellEffIndex
{
Expand Down
2 changes: 1 addition & 1 deletion src/server/scripts/Commands/cs_debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1325,7 +1325,7 @@ class debug_commandscript : public CommandScript
{
Player* player = handler->GetSession()->GetPlayer();

sLog->outSQLDev("(@PATH, XX, %.3f, %.3f, %.5f, 0,0, 0,100, 0),", player->GetPositionX(), player->GetPositionY(), player->GetPositionZ());
sLog->outSQLDev("(@PATH, XX, %.3f, %.3f, %.5f, 0, 0, 0, 100, 0),", player->GetPositionX(), player->GetPositionY(), player->GetPositionZ());

handler->PSendSysMessage("Waypoint SQL written to SQL Developer log");
return true;
Expand Down

0 comments on commit b72373f

Please sign in to comment.