aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/mangos.sql6
-rw-r--r--sql/updates/7896_01_mangos_creature_template.sql4
-rw-r--r--src/game/Creature.cpp12
-rw-r--r--src/game/Creature.h4
-rw-r--r--src/game/ObjectMgr.cpp8
5 files changed, 19 insertions, 15 deletions
diff --git a/sql/mangos.sql b/sql/mangos.sql
index 2530e9d5811..0aa0dc58820 100644
--- a/sql/mangos.sql
+++ b/sql/mangos.sql
@@ -23,7 +23,7 @@ DROP TABLE IF EXISTS `db_version`;
CREATE TABLE `db_version` (
`version` varchar(120) default NULL,
`creature_ai_version` varchar(120) default NULL,
- `required_7893_01_mangos_command` bit(1) default NULL
+ `required_7896_01_mangos_creature_template` bit(1) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes';
--
@@ -819,8 +819,8 @@ CREATE TABLE `creature_template` (
`family` tinyint(4) NOT NULL default '0',
`trainer_type` tinyint(4) NOT NULL default '0',
`trainer_spell` mediumint(8) unsigned NOT NULL default '0',
- `class` tinyint(3) unsigned NOT NULL default '0',
- `race` tinyint(3) unsigned NOT NULL default '0',
+ `trainer_class` tinyint(3) unsigned NOT NULL default '0',
+ `trainer_race` tinyint(3) unsigned NOT NULL default '0',
`minrangedmg` float NOT NULL default '0',
`maxrangedmg` float NOT NULL default '0',
`rangedattackpower` smallint(5) unsigned NOT NULL default '0',
diff --git a/sql/updates/7896_01_mangos_creature_template.sql b/sql/updates/7896_01_mangos_creature_template.sql
new file mode 100644
index 00000000000..51146095825
--- /dev/null
+++ b/sql/updates/7896_01_mangos_creature_template.sql
@@ -0,0 +1,4 @@
+ALTER TABLE db_version CHANGE COLUMN required_7893_01_mangos_command required_7896_01_mangos_creature_template bit;
+
+ALTER TABLE creature_template CHANGE COLUMN class trainer_class tinyint(3) unsigned NOT NULL default '0';
+ALTER TABLE creature_template CHANGE COLUMN race trainer_race tinyint(3) unsigned NOT NULL default '0';
diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp
index 3c90f4b3b62..aba48f985b7 100644
--- a/src/game/Creature.cpp
+++ b/src/game/Creature.cpp
@@ -733,12 +733,12 @@ bool Creature::isCanTrainingOf(Player* pPlayer, bool msg) const
switch(GetCreatureInfo()->trainer_type)
{
case TRAINER_TYPE_CLASS:
- if(pPlayer->getClass()!=GetCreatureInfo()->classNum)
+ if(pPlayer->getClass()!=GetCreatureInfo()->trainer_class)
{
if(msg)
{
pPlayer->PlayerTalkClass->ClearMenus();
- switch(GetCreatureInfo()->classNum)
+ switch(GetCreatureInfo()->trainer_class)
{
case CLASS_DRUID: pPlayer->PlayerTalkClass->SendGossipMenu( 4913,GetGUID()); break;
case CLASS_HUNTER: pPlayer->PlayerTalkClass->SendGossipMenu(10090,GetGUID()); break;
@@ -763,12 +763,12 @@ bool Creature::isCanTrainingOf(Player* pPlayer, bool msg) const
}
break;
case TRAINER_TYPE_MOUNTS:
- if(GetCreatureInfo()->race && pPlayer->getRace() != GetCreatureInfo()->race)
+ if(GetCreatureInfo()->trainer_race && pPlayer->getRace() != GetCreatureInfo()->trainer_race)
{
if(msg)
{
pPlayer->PlayerTalkClass->ClearMenus();
- switch(GetCreatureInfo()->classNum)
+ switch(GetCreatureInfo()->trainer_class)
{
case RACE_DWARF: pPlayer->PlayerTalkClass->SendGossipMenu(5865,GetGUID()); break;
case RACE_GNOME: pPlayer->PlayerTalkClass->SendGossipMenu(4881,GetGUID()); break;
@@ -838,7 +838,7 @@ bool Creature::isCanTrainingAndResetTalentsOf(Player* pPlayer) const
{
return pPlayer->getLevel() >= 10
&& GetCreatureInfo()->trainer_type == TRAINER_TYPE_CLASS
- && pPlayer->getClass() == GetCreatureInfo()->classNum;
+ && pPlayer->getClass() == GetCreatureInfo()->trainer_class;
}
void Creature::prepareGossipMenu( Player *pPlayer,uint32 gossipid )
@@ -904,7 +904,7 @@ void Creature::prepareGossipMenu( Player *pPlayer,uint32 gossipid )
cantalking=false;
break;
case GOSSIP_OPTION_UNLEARNPETSKILLS:
- if(!pPlayer->GetPet() || pPlayer->GetPet()->getPetType() != HUNTER_PET || pPlayer->GetPet()->m_spells.size() <= 1 || GetCreatureInfo()->trainer_type != TRAINER_TYPE_PETS || GetCreatureInfo()->classNum != CLASS_HUNTER)
+ if(!pPlayer->GetPet() || pPlayer->GetPet()->getPetType() != HUNTER_PET || pPlayer->GetPet()->m_spells.size() <= 1 || GetCreatureInfo()->trainer_type != TRAINER_TYPE_PETS || GetCreatureInfo()->trainer_class != CLASS_HUNTER)
cantalking=false;
break;
case GOSSIP_OPTION_TAXIVENDOR:
diff --git a/src/game/Creature.h b/src/game/Creature.h
index c22d670556b..9c94fa64423 100644
--- a/src/game/Creature.h
+++ b/src/game/Creature.h
@@ -207,8 +207,8 @@ struct CreatureInfo
uint32 family; // enum CreatureFamily values (optional)
uint32 trainer_type;
uint32 trainer_spell;
- uint32 classNum;
- uint32 race;
+ uint32 trainer_class;
+ uint32 trainer_race;
float minrangedmg;
float maxrangedmg;
uint32 rangedattackpower;
diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp
index d7337fadd77..0e684ee4213 100644
--- a/src/game/ObjectMgr.cpp
+++ b/src/game/ObjectMgr.cpp
@@ -559,15 +559,15 @@ void ObjectMgr::LoadCreatureTemplates()
continue;
}
- if(cInfo->classNum != heroicInfo->classNum)
+ if(cInfo->trainer_class != heroicInfo->trainer_class)
{
- sLog.outErrorDb("Creature (Entry: %u) listed in `creature_template_substitution` has different `classNum` in heroic mode.",i);
+ sLog.outErrorDb("Creature (Entry: %u) has different `trainer_class` in heroic mode (Entry: %u).",i,cInfo->HeroicEntry);
continue;
}
- if(cInfo->race != heroicInfo->race)
+ if(cInfo->trainer_race != heroicInfo->trainer_race)
{
- sLog.outErrorDb("Creature (Entry: %u) listed in `creature_template_substitution` has different `race` in heroic mode.",i);
+ sLog.outErrorDb("Creature (Entry: %u) has different `trainer_race` in heroic mode (Entry: %u).",i,cInfo->HeroicEntry);
continue;
}