diff --git a/sql/migrations/20190123062532_world.sql b/sql/migrations/20190123062532_world.sql new file mode 100644 index 000000000..d1cb27d30 --- /dev/null +++ b/sql/migrations/20190123062532_world.sql @@ -0,0 +1,98 @@ +DROP PROCEDURE IF EXISTS add_migration; +delimiter ?? +CREATE PROCEDURE `add_migration`() +BEGIN +DECLARE v INT DEFAULT 1; +SET v = (SELECT COUNT(*) FROM `migrations` WHERE `id`='20190123062532'); +IF v=0 THEN +INSERT INTO `migrations` VALUES ('20190123062532'); +-- Add your query below. + + +ALTER TABLE `creature_template` + DROP COLUMN `KillCredit1`, + DROP COLUMN `KillCredit2`; +ALTER TABLE `creature_template` + CHANGE COLUMN `modelid_1` `display_id1` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0' AFTER `patch`, + CHANGE COLUMN `modelid_2` `display_id2` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0' AFTER `display_id1`, + CHANGE COLUMN `modelid_3` `display_id3` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0' AFTER `display_id2`, + CHANGE COLUMN `modelid_4` `display_id4` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0' AFTER `display_id3`, + CHANGE COLUMN `minlevel` `level_min` TINYINT(3) UNSIGNED NOT NULL DEFAULT '1' AFTER `gossip_menu_id`, + CHANGE COLUMN `maxlevel` `level_max` TINYINT(3) UNSIGNED NOT NULL DEFAULT '1' AFTER `level_min`, + CHANGE COLUMN `minhealth` `health_min` INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTER `level_max`, + CHANGE COLUMN `maxhealth` `health_max` INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTER `health_min`, + CHANGE COLUMN `minmana` `mana_min` INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTER `health_max`, + CHANGE COLUMN `maxmana` `mana_max` INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTER `mana_min`, + CHANGE COLUMN `npcflag` `npc_flags` INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTER `faction`, + CHANGE COLUMN `Detection` `detection_range` FLOAT NOT NULL DEFAULT '20' AFTER `scale`, + CHANGE COLUMN `CallForHelp` `call_for_help_range` FLOAT NOT NULL DEFAULT '5' AFTER `detection_range`, + CHANGE COLUMN `Leash` `leash_range` FLOAT NOT NULL DEFAULT '0' AFTER `call_for_help_range`, + CHANGE COLUMN `ExperienceMultiplier` `xp_multiplier` FLOAT NOT NULL DEFAULT '1' AFTER `rank`, + CHANGE COLUMN `mindmg` `dmg_min` FLOAT NOT NULL DEFAULT '0' AFTER `xp_multiplier`, + CHANGE COLUMN `maxdmg` `dmg_max` FLOAT NOT NULL DEFAULT '0' AFTER `dmg_min`, + CHANGE COLUMN `dmgschool` `dmg_school` TINYINT(4) NOT NULL DEFAULT '0' AFTER `dmg_max`, + CHANGE COLUMN `attackpower` `attack_power` INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTER `dmg_school`, + CHANGE COLUMN `baseattacktime` `base_attack_time` INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTER `dmg_multiplier`, + CHANGE COLUMN `rangeattacktime` `ranged_attack_time` INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTER `base_attack_time`, + CHANGE COLUMN `dynamicflags` `dynamic_flags` INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTER `unit_flags`, + CHANGE COLUMN `family` `beast_family` TINYINT(4) NOT NULL DEFAULT '0' AFTER `dynamic_flags`, + CHANGE COLUMN `minrangedmg` `ranged_dmg_min` FLOAT NOT NULL DEFAULT '0' AFTER `trainer_race`, + CHANGE COLUMN `maxrangedmg` `ranged_dmg_max` FLOAT NOT NULL DEFAULT '0' AFTER `ranged_dmg_min`, + CHANGE COLUMN `rangedattackpower` `ranged_attack_power` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `ranged_dmg_max`, + CHANGE COLUMN `lootid` `loot_id` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0' AFTER `type_flags`, + CHANGE COLUMN `pickpocketloot` `pickpocket_loot_id` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0' AFTER `loot_id`, + CHANGE COLUMN `skinloot` `skinning_loot_id` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0' AFTER `pickpocket_loot_id`, + CHANGE COLUMN `resistance1` `holy_res` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `skinning_loot_id`, + CHANGE COLUMN `resistance2` `fire_res` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `holy_res`, + CHANGE COLUMN `resistance3` `nature_res` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `fire_res`, + CHANGE COLUMN `resistance4` `frost_res` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `nature_res`, + CHANGE COLUMN `resistance5` `shadow_res` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `frost_res`, + CHANGE COLUMN `resistance6` `arcane_res` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `shadow_res`, + CHANGE COLUMN `spell1` `spell_id1` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0' AFTER `arcane_res`, + CHANGE COLUMN `spell2` `spell_id2` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0' AFTER `spell_id1`, + CHANGE COLUMN `spell3` `spell_id3` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0' AFTER `spell_id2`, + CHANGE COLUMN `spell4` `spell_id4` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0' AFTER `spell_id3`, + CHANGE COLUMN `spells_template` `spell_list_id` INT(11) UNSIGNED NOT NULL DEFAULT '0' AFTER `spell_id4`, + CHANGE COLUMN `PetSpellDataId` `pet_spell_list_id` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0' AFTER `spell_list_id`, + CHANGE COLUMN `mingold` `gold_min` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0' AFTER `pet_spell_list_id`, + CHANGE COLUMN `maxgold` `gold_max` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0' AFTER `gold_min`, + CHANGE COLUMN `AIName` `ai_name` CHAR(64) NOT NULL DEFAULT '' AFTER `gold_max`, + CHANGE COLUMN `MovementType` `movement_type` TINYINT(3) UNSIGNED NULL DEFAULT '0' AFTER `ai_name`, + CHANGE COLUMN `InhabitType` `inhabit_type` TINYINT(3) UNSIGNED NOT NULL DEFAULT '3' AFTER `movement_type`, + CHANGE COLUMN `Civilian` `civilian` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `inhabit_type`, + CHANGE COLUMN `RacialLeader` `racial_leader` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `civilian`, + CHANGE COLUMN `RegenHealth` `regeneration` TINYINT(3) UNSIGNED NOT NULL DEFAULT '1' AFTER `racial_leader`, + CHANGE COLUMN `MechanicImmuneMask` `mechanic_immune_mask` INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTER `vendor_id`, + CHANGE COLUMN `SchoolImmuneMask` `school_immune_max` INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTER `mechanic_immune_mask`, + CHANGE COLUMN `ScriptName` `script_name` CHAR(64) NOT NULL DEFAULT '' AFTER `flags_extra`; +ALTER TABLE `gameobject_template` + CHANGE COLUMN `ScriptName` `script_name` VARCHAR(64) NOT NULL DEFAULT '' AFTER `maxgold`; +ALTER TABLE `scripted_areatrigger` + CHANGE COLUMN `ScriptName` `script_name` CHAR(64) NOT NULL AFTER `entry`; +ALTER TABLE `scripted_event_id` + CHANGE COLUMN `ScriptName` `script_name` CHAR(64) NOT NULL AFTER `id`; +ALTER TABLE `map_template` + CHANGE COLUMN `Entry` `entry` SMALLINT(5) UNSIGNED NOT NULL FIRST, + CHANGE COLUMN `Parent` `parent` INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTER `patch`, + CHANGE COLUMN `MapType` `map_type` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `parent`, + CHANGE COLUMN `LinkedZone` `linked_zone` INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTER `map_type`, + CHANGE COLUMN `LevelMin` `level_min` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `linked_zone`, + CHANGE COLUMN `LevelMax` `level_max` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `level_min`, + CHANGE COLUMN `MaxPlayers` `player_limit` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `level_max`, + CHANGE COLUMN `ResetDelay` `reset_delay` INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTER `player_limit`, + CHANGE COLUMN `GhostEntranceMap` `ghost_entrance_map` SMALLINT(5) NOT NULL DEFAULT '-1' AFTER `reset_delay`, + CHANGE COLUMN `GhostEntranceX` `ghost_entrance_x` FLOAT NOT NULL DEFAULT '0' AFTER `ghost_entrance_map`, + CHANGE COLUMN `GhostEntranceY` `ghost_entrance_y` FLOAT NOT NULL DEFAULT '0' AFTER `ghost_entrance_x`, + CHANGE COLUMN `MapName` `map_name` VARCHAR(128) NOT NULL DEFAULT '' AFTER `ghost_entrance_y`, + CHANGE COLUMN `ScriptName` `script_name` VARCHAR(128) NOT NULL DEFAULT '' AFTER `map_name`; +ALTER TABLE `creature_template` + CHANGE COLUMN `regeneration` `regeneration` TINYINT(3) UNSIGNED NOT NULL DEFAULT '3' AFTER `racial_leader`; +UPDATE `creature_template` SET `regeneration`=3 WHERE `regeneration`=1; + + +-- End of migration. +END IF; +END?? +delimiter ; +CALL add_migration(); +DROP PROCEDURE IF EXISTS add_migration; diff --git a/src/game/AI/AggressorAI.cpp b/src/game/AI/AggressorAI.cpp index 722c02fa3..e185f2ec1 100644 --- a/src/game/AI/AggressorAI.cpp +++ b/src/game/AI/AggressorAI.cpp @@ -59,7 +59,7 @@ void AggressorAI::UpdateAI(const uint32 uiDiff) return; if (!m_CreatureSpells.empty()) - DoSpellTemplateCasts(uiDiff); + DoSpellsListCasts(uiDiff); DoMeleeAttackIfReady(); } diff --git a/src/game/AI/CreatureAI.cpp b/src/game/AI/CreatureAI.cpp index 03ba9e2d0..43b813f68 100644 --- a/src/game/AI/CreatureAI.cpp +++ b/src/game/AI/CreatureAI.cpp @@ -33,7 +33,7 @@ CreatureAI::~CreatureAI() void CreatureAI::JustRespawned() { // Reset spells template to default on respawn. - SetSpellsTemplate(m_creature->GetCreatureInfo()->spells_template); + SetSpellsList(m_creature->GetCreatureInfo()->spell_list_id); // Reset combat movement and melee attack. m_bCombatMovement = true; @@ -163,27 +163,27 @@ CanCastResult CreatureAI::DoCastSpellIfCan(Unit* pTarget, uint32 uiSpell, uint32 return CAST_FAIL_IS_CASTING; } -void CreatureAI::SetSpellsTemplate(uint32 entry) +void CreatureAI::SetSpellsList(uint32 entry) { if (entry == 0) m_CreatureSpells.clear(); - else if (const CreatureSpellsTemplate* pSpellsTemplate = sObjectMgr.GetCreatureSpellsTemplate(entry)) - SetSpellsTemplate(pSpellsTemplate); + else if (const CreatureSpellsList* pSpellsTemplate = sObjectMgr.GetCreatureSpellsList(entry)) + SetSpellsList(pSpellsTemplate); else sLog.outError("CreatureAI: Attempt to set spells template of creature %u to non-existent entry %u.", m_creature->GetEntry(), entry); } -void CreatureAI::SetSpellsTemplate(const CreatureSpellsTemplate *SpellsTemplate) +void CreatureAI::SetSpellsList(const CreatureSpellsList *pSpellsList) { m_CreatureSpells.clear(); - for (const auto & entry : *SpellsTemplate) + for (const auto & entry : *pSpellsList) { m_CreatureSpells.push_back(CreatureAISpellsEntry(entry)); } m_CreatureSpells.shrink_to_fit(); } -void CreatureAI::DoSpellTemplateCasts(const uint32 uiDiff) +void CreatureAI::DoSpellsListCasts(const uint32 uiDiff) { bool bDontCast = false; for (auto & spell : m_CreatureSpells) @@ -412,7 +412,7 @@ void CreatureAI::SetCombatMovement(bool enabled) void CreatureAI::OnCombatStop() { // Reset back to default spells template. This also resets timers. - SetSpellsTemplate(m_creature->GetCreatureInfo()->spells_template); + SetSpellsList(m_creature->GetCreatureInfo()->spell_list_id); // Reset combat movement and melee attack. m_bCombatMovement = true; diff --git a/src/game/AI/CreatureAI.h b/src/game/AI/CreatureAI.h index dbca4cbc4..fac620e4a 100644 --- a/src/game/AI/CreatureAI.h +++ b/src/game/AI/CreatureAI.h @@ -68,7 +68,7 @@ class MANGOS_DLL_SPEC CreatureAI public: explicit CreatureAI(Creature* creature) : m_creature(creature), m_bUseAiAtControl(false), m_uLastAlertTime(0), m_bMeleeAttack(true), m_bCombatMovement(true) { - SetSpellsTemplate(creature->GetCreatureInfo()->spells_template); + SetSpellsList(creature->GetCreatureInfo()->spell_list_id); } virtual ~CreatureAI(); @@ -216,12 +216,12 @@ class MANGOS_DLL_SPEC CreatureAI // Clears any group/raid icons this creature may have void ClearTargetIcon(); - // Assigns a creature_spells template to the AI. - void SetSpellsTemplate(uint32 entry); - void SetSpellsTemplate(const CreatureSpellsTemplate* SpellsTemplate); + // Assigns a creature_spells list to the AI. + void SetSpellsList(uint32 entry); + void SetSpellsList(const CreatureSpellsList* pSpellsList); - // Goes through the creature_spells template to update timers and cast spells. - void DoSpellTemplateCasts(const uint32 uiDiff); + // Goes through the creature's spells list to update timers and cast spells. + void DoSpellsListCasts(const uint32 uiDiff); // Enables or disables melee attacks. void SetMeleeAttack(bool enabled); diff --git a/src/game/AI/CreatureEventAI.cpp b/src/game/AI/CreatureEventAI.cpp index 853c517a1..130240b2c 100644 --- a/src/game/AI/CreatureEventAI.cpp +++ b/src/game/AI/CreatureEventAI.cpp @@ -745,7 +745,7 @@ void CreatureEventAI::UpdateAI(const uint32 diff) if (Combat) { if (!m_CreatureSpells.empty()) - DoSpellTemplateCasts(diff); + DoSpellsListCasts(diff); DoMeleeAttackIfReady(); } diff --git a/src/game/AI/GuardAI.cpp b/src/game/AI/GuardAI.cpp index d74ef79cc..df9f6be50 100644 --- a/src/game/AI/GuardAI.cpp +++ b/src/game/AI/GuardAI.cpp @@ -93,7 +93,7 @@ void GuardAI::UpdateAI(const uint32 uiDiff) return; if (!m_CreatureSpells.empty()) - DoSpellTemplateCasts(uiDiff); + DoSpellsListCasts(uiDiff); DoMeleeAttackIfReady(); } diff --git a/src/game/AI/PetEventAI.cpp b/src/game/AI/PetEventAI.cpp index fecba04bb..8971e4432 100644 --- a/src/game/AI/PetEventAI.cpp +++ b/src/game/AI/PetEventAI.cpp @@ -186,7 +186,7 @@ void PetEventAI::UpdateAI(const uint32 uiDiff) if (bHasVictim) { if (!m_CreatureSpells.empty()) - DoSpellTemplateCasts(uiDiff); + DoSpellsListCasts(uiDiff); DoMeleeAttackIfReady(); } diff --git a/src/game/AI/ReactorAI.cpp b/src/game/AI/ReactorAI.cpp index f2b2cc637..7c5a85be4 100644 --- a/src/game/AI/ReactorAI.cpp +++ b/src/game/AI/ReactorAI.cpp @@ -55,7 +55,7 @@ void ReactorAI::UpdateAI(const uint32 uiDiff) return; if (!m_CreatureSpells.empty()) - DoSpellTemplateCasts(uiDiff); + DoSpellsListCasts(uiDiff); DoMeleeAttackIfReady(); } diff --git a/src/game/AI/ScriptedAI.cpp b/src/game/AI/ScriptedAI.cpp index 431719424..800498dac 100644 --- a/src/game/AI/ScriptedAI.cpp +++ b/src/game/AI/ScriptedAI.cpp @@ -80,7 +80,7 @@ void ScriptedAI::UpdateAI(const uint32 uiDiff) m_creature->SelectHostileTarget(); if (!m_CreatureSpells.empty() && m_creature->isInCombat()) - DoSpellTemplateCasts(uiDiff); + DoSpellsListCasts(uiDiff); DoMeleeAttackIfReady(); } @@ -100,7 +100,7 @@ void ScriptedAI::EnterEvadeMode() m_creature->SetLootRecipient(nullptr); // Reset back to default spells template. This also resets timers. - SetSpellsTemplate(m_creature->GetCreatureInfo()->spells_template); + SetSpellsList(m_creature->GetCreatureInfo()->spell_list_id); Reset(); } @@ -256,7 +256,7 @@ void ScriptedAI::SetEquipmentSlots(bool bLoadDefault, int32 uiMainHand, int32 ui { if (bLoadDefault) { - m_creature->LoadEquipment(m_creature->GetCreatureInfo()->equipmentId,true); + m_creature->LoadEquipment(m_creature->GetCreatureInfo()->equipment_id,true); return; } diff --git a/src/game/AI/ScriptedEscortAI.cpp b/src/game/AI/ScriptedEscortAI.cpp index 67d55d188..091b08f90 100644 --- a/src/game/AI/ScriptedEscortAI.cpp +++ b/src/game/AI/ScriptedEscortAI.cpp @@ -205,7 +205,7 @@ void npc_escortAI::EnterEvadeMode() ResetCreature(); // Reset back to default spells template. This also resets timers. - SetSpellsTemplate(m_creature->GetCreatureInfo()->spells_template); + SetSpellsList(m_creature->GetCreatureInfo()->spell_list_id); ReturnToCombatStartPosition(); Reset(); @@ -347,7 +347,7 @@ void npc_escortAI::UpdateEscortAI(const uint32 uiDiff) return; if (!m_CreatureSpells.empty()) - DoSpellTemplateCasts(uiDiff); + DoSpellsListCasts(uiDiff); DoMeleeAttackIfReady(); } diff --git a/src/game/AI/ScriptedFollowerAI.cpp b/src/game/AI/ScriptedFollowerAI.cpp index fa5e0bb70..38883e4f0 100644 --- a/src/game/AI/ScriptedFollowerAI.cpp +++ b/src/game/AI/ScriptedFollowerAI.cpp @@ -204,7 +204,7 @@ void FollowerAI::EnterEvadeMode() } // Reset back to default spells template. This also resets timers. - SetSpellsTemplate(m_creature->GetCreatureInfo()->spells_template); + SetSpellsList(m_creature->GetCreatureInfo()->spell_list_id); Reset(); } @@ -285,7 +285,7 @@ void FollowerAI::UpdateFollowerAI(const uint32 uiDiff) return; if (!m_CreatureSpells.empty()) - DoSpellTemplateCasts(uiDiff); + DoSpellsListCasts(uiDiff); DoMeleeAttackIfReady(); } diff --git a/src/game/AI/ScriptedPetAI.cpp b/src/game/AI/ScriptedPetAI.cpp index 26f188d3a..2107e9ff7 100644 --- a/src/game/AI/ScriptedPetAI.cpp +++ b/src/game/AI/ScriptedPetAI.cpp @@ -77,7 +77,7 @@ void ScriptedPetAI::ResetPetCombat() void ScriptedPetAI::UpdatePetAI(const uint32 uiDiff) { if (!m_CreatureSpells.empty()) - DoSpellTemplateCasts(uiDiff); + DoSpellsListCasts(uiDiff); DoMeleeAttackIfReady(); } diff --git a/src/game/Battlegrounds/BattleGroundAV.cpp b/src/game/Battlegrounds/BattleGroundAV.cpp index 888b3cc2f..b388aaec5 100644 --- a/src/game/Battlegrounds/BattleGroundAV.cpp +++ b/src/game/Battlegrounds/BattleGroundAV.cpp @@ -282,7 +282,7 @@ void BattleGroundAV::HandleKillUnit(Creature *creature, Player *killer) { // Stop landmines respawn uint8 eventIdx = creature->GetEntry() == NPC_LANDMINES_LAYER_A2 ? BG_AV_LANDMINES_ALLIANCE : BG_AV_LANDMINES_HORDE; - m_ActiveEvents[eventIdx] = 1; // Cf ScriptName "go_av_landmineAI" + m_ActiveEvents[eventIdx] = 1; // Cf script_name "go_av_landmineAI" return; } case NPC_LANDMINES_EXPERT_A2: diff --git a/src/game/Commands/Level2.cpp b/src/game/Commands/Level2.cpp index e08219613..26f62b687 100644 --- a/src/game/Commands/Level2.cpp +++ b/src/game/Commands/Level2.cpp @@ -1783,7 +1783,7 @@ bool ChatHandler::HandleNpcChangeLevelCommand(char* args) return true; } -//set npcflag of creature +//set npc_flags of creature bool ChatHandler::HandleNpcFlagCommand(char* args) { if (!*args) @@ -1802,7 +1802,7 @@ bool ChatHandler::HandleNpcFlagCommand(char* args) pCreature->SetUInt32Value(UNIT_NPC_FLAGS, npcFlags); - WorldDatabase.PExecuteLog("UPDATE creature_template SET npcflag = '%u' WHERE entry = '%u'", npcFlags, pCreature->GetEntry()); + WorldDatabase.PExecuteLog("UPDATE creature_template SET npc_flags = '%u' WHERE entry = '%u'", npcFlags, pCreature->GetEntry()); SendSysMessage(LANG_VALUE_SAVED_REJOIN); @@ -4467,7 +4467,7 @@ bool ChatHandler::HandlePoolSpawnsCommand(char* args) if (CreatureData const* data = sObjectMgr.GetCreatureData(*itr)) if (CreatureInfo const* info = ObjectMgr::GetCreatureTemplate(data->id)) PSendSysMessage(LANG_CREATURE_LIST_CHAT, *itr, PrepareStringNpcOrGoSpawnInformation(*itr).c_str(), - *itr, info->Name, data->posX, data->posY, data->posZ, data->mapid); + *itr, info->name, data->posX, data->posY, data->posZ, data->mapid); SpawnedPoolObjects const& goSpawns = spawns.GetSpawnedGameobjects(); for (SpawnedPoolObjects::const_iterator itr = goSpawns.begin(); itr != goSpawns.end(); ++itr) @@ -4525,10 +4525,10 @@ bool ChatHandler::HandlePoolInfoCommand(char* args) char const* active = crSpawns && crSpawns->find(itr->guid) != crSpawns->end() ? active_str.c_str() : ""; if (m_session) PSendSysMessage(LANG_POOL_CHANCE_CREATURE_LIST_CHAT, itr->guid, PrepareStringNpcOrGoSpawnInformation(itr->guid).c_str(), - itr->guid, info->Name, data->posX, data->posY, data->posZ, data->mapid, itr->chance, active); + itr->guid, info->name, data->posX, data->posY, data->posZ, data->mapid, itr->chance, active); else PSendSysMessage(LANG_POOL_CHANCE_CREATURE_LIST_CONSOLE, itr->guid, PrepareStringNpcOrGoSpawnInformation(itr->guid).c_str(), - info->Name, data->posX, data->posY, data->posZ, data->mapid, itr->chance, active); + info->name, data->posX, data->posY, data->posZ, data->mapid, itr->chance, active); } } } @@ -4547,10 +4547,10 @@ bool ChatHandler::HandlePoolInfoCommand(char* args) char const* active = crSpawns && crSpawns->find(itr->guid) != crSpawns->end() ? active_str.c_str() : ""; if (m_session) PSendSysMessage(LANG_POOL_CREATURE_LIST_CHAT, itr->guid, PrepareStringNpcOrGoSpawnInformation(itr->guid).c_str(), - itr->guid, info->Name, data->posX, data->posY, data->posZ, data->mapid, active); + itr->guid, info->name, data->posX, data->posY, data->posZ, data->mapid, active); else PSendSysMessage(LANG_POOL_CREATURE_LIST_CONSOLE, itr->guid, PrepareStringNpcOrGoSpawnInformation(itr->guid).c_str(), - info->Name, data->posX, data->posY, data->posZ, data->mapid, active); + info->name, data->posX, data->posY, data->posZ, data->mapid, active); } } } diff --git a/src/game/Commands/Level3.cpp b/src/game/Commands/Level3.cpp index ed29fda6c..a7911aaaa 100644 --- a/src/game/Commands/Level3.cpp +++ b/src/game/Commands/Level3.cpp @@ -2116,9 +2116,9 @@ bool ChatHandler::HandleLearnAllMyTaxisCommand(char* /*args*/) for (uint32 i = 0; i < sCreatureStorage.GetMaxEntry(); ++i) { if (const CreatureInfo *cInfo = sCreatureStorage.LookupEntry(i)) - if (cInfo->npcflag & UNIT_NPC_FLAG_FLIGHTMASTER) + if (cInfo->npc_flags & UNIT_NPC_FLAG_FLIGHTMASTER) { - FindCreatureData worker(cInfo->Entry, player); + FindCreatureData worker(cInfo->entry, player); sObjectMgr.DoCreatureData(worker); if (CreatureDataPair const* dataPair = worker.GetResult()) if (CreatureData const* data = &dataPair->second) @@ -2820,9 +2820,9 @@ bool ChatHandler::HandleListCreatureCommand(char* args) int mapid = fields[4].GetUInt16(); if (m_session) - PSendSysMessage(LANG_CREATURE_LIST_CHAT, guid, PrepareStringNpcOrGoSpawnInformation(guid).c_str(), guid, cInfo->Name, x, y, z, mapid); + PSendSysMessage(LANG_CREATURE_LIST_CHAT, guid, PrepareStringNpcOrGoSpawnInformation(guid).c_str(), guid, cInfo->name, x, y, z, mapid); else - PSendSysMessage(LANG_CREATURE_LIST_CONSOLE, guid, PrepareStringNpcOrGoSpawnInformation(guid).c_str(), cInfo->Name, x, y, z, mapid); + PSendSysMessage(LANG_CREATURE_LIST_CONSOLE, guid, PrepareStringNpcOrGoSpawnInformation(guid).c_str(), cInfo->name, x, y, z, mapid); } while (result->NextRow()); @@ -3312,7 +3312,7 @@ bool ChatHandler::HandleLookupCreatureCommand(char* args) } } - std::string name = cInfo->Name; + std::string name = cInfo->name; if (name.empty()) continue; @@ -3399,8 +3399,8 @@ bool ChatHandler::HandleLookupCreatureModelCommand(char* args) uint32 foundModelCounter = 0; uint32 totalModelCounter = 0; for (int i = 0; i < MAX_CREATURE_MODEL; ++i) - if (cInfo->ModelId[i]) - if (CreatureDisplayInfoEntry const* display = sCreatureDisplayInfoStore.LookupEntry(cInfo->ModelId[i])) + if (cInfo->display_id[i]) + if (CreatureDisplayInfoEntry const* display = sCreatureDisplayInfoStore.LookupEntry(cInfo->display_id[i])) { if (display->ModelId) totalModelCounter++; @@ -3409,19 +3409,19 @@ bool ChatHandler::HandleLookupCreatureModelCommand(char* args) if (!foundModelCounter) { // Custom filter - //if (cInfo->InhabitType & INHABIT_WATER) + //if (cInfo->inhabit_type & INHABIT_WATER) { creatureCounter++; if (fileExport) - toExport << id << ", /* " << cInfo->Name << " */\n"; - PSendSysMessage(LANG_CREATURE_ENTRY_LIST_CHAT, id, id, cInfo->Name); + toExport << id << ", /* " << cInfo->name << " */\n"; + PSendSysMessage(LANG_CREATURE_ENTRY_LIST_CHAT, id, id, cInfo->name); } } foundModelCounter++; } } if (fileExport && foundModelCounter && totalModelCounter != foundModelCounter) - toExport << "-- WARNING " << id << " " << cInfo->Name << " uses more than one model !\n"; + toExport << "-- WARNING " << id << " " << cInfo->name << " uses more than one model !\n"; } modelId = 0; } @@ -4330,10 +4330,10 @@ bool ChatHandler::HandleNpcInfoCommand(char* /*args*/) PSendSysMessage(LANG_NPCINFO_HEALTH, target->GetCreateHealth(), target->GetMaxHealth(), target->GetHealth()); if (target->getPowerType() == POWER_MANA) PSendSysMessage(LANG_NPCINFO_MANA, target->GetCreateMana(), target->GetMaxPower(POWER_MANA), target->GetPower(POWER_MANA)); - PSendSysMessage(LANG_NPCINFO_INHABIT_TYPE, cInfo->InhabitType); + PSendSysMessage(LANG_NPCINFO_INHABIT_TYPE, cInfo->inhabit_type); PSendSysMessage(LANG_NPCINFO_FLAGS, target->GetUInt32Value(UNIT_FIELD_FLAGS), target->GetUInt32Value(UNIT_DYNAMIC_FLAGS), target->getFaction()); PSendSysMessage(LANG_COMMAND_RAWPAWNTIMES, defRespawnDelayStr.c_str(), curRespawnDelayStr.c_str()); - PSendSysMessage(LANG_NPCINFO_LOOT, cInfo->lootid, cInfo->pickpocketLootId, cInfo->SkinLootId); + PSendSysMessage(LANG_NPCINFO_LOOT, cInfo->loot_id, cInfo->pickpocket_loot_id, cInfo->skinning_loot_id); PSendSysMessage(LANG_NPCINFO_ARMOR, target->GetArmor()); PSendSysMessage(LANG_NPCINFO_DUNGEON_ID, target->GetInstanceId()); PSendSysMessage(LANG_NPCINFO_POSITION, float(target->GetPositionX()), float(target->GetPositionY()), float(target->GetPositionZ())); diff --git a/src/game/Commands/Nostalrius.cpp b/src/game/Commands/Nostalrius.cpp index d119f73af..17ca5ecb3 100644 --- a/src/game/Commands/Nostalrius.cpp +++ b/src/game/Commands/Nostalrius.cpp @@ -350,11 +350,11 @@ bool ChatHandler::HandleEscortShowWpCommand(char *args) const auto pPlayer = m_session->GetPlayer(); auto map = pPlayer->GetMap(); - auto &scriptPoints = sScriptMgr.GetPointMoveList(cInfo->Entry); + auto &scriptPoints = sScriptMgr.GetPointMoveList(cInfo->entry); if (scriptPoints.empty()) { - PSendSysMessage(LANG_WAYPOINT_NOTFOUND, cInfo->Entry); + PSendSysMessage(LANG_WAYPOINT_NOTFOUND, cInfo->entry); SetSentErrorMessage(true); return false; } diff --git a/src/game/Database/SQLStorages.cpp b/src/game/Database/SQLStorages.cpp index fd8a14fbd..92b41426b 100644 --- a/src/game/Database/SQLStorages.cpp +++ b/src/game/Database/SQLStorages.cpp @@ -24,8 +24,8 @@ #include "Database/SQLStorageImpl.h" #include "Database/DatabaseEnv.h" -const char CreatureInfosrcfmt[] = "iiiiiiissiiiiiiiiiiffffffifffiifiiiiiiiiiiffiiiiiiiiiiiiiiiiiiiisiiilliiiiiis"; -const char CreatureInfodstfmt[] = "iiiiiiissiiiiiiiiiiffffffifffiifiiiiiiiiiiffiiiiiiiiiiiiiiiiiiiisiiilliiiiiii"; +const char CreatureInfosrcfmt[] = "iiiiissiiiiiiiiiiffffffifffiifiiiiiiiiiiffiiiiiiiiiiiiiiiiiiiisiiiliiiiiiis"; +const char CreatureInfodstfmt[] = "iiiiissiiiiiiiiiiffffffifffiifiiiiiiiiiiffiiiiiiiiiiiiiiiiiiiisiiiliiiiiiii"; const char CreatureDataAddonInfofmt[] = "iiibbiis"; const char CreatureModelfmt[] = "iffbii"; const char CreatureInfoAddonInfofmt[] = "iiibbiis"; diff --git a/src/game/Formulas.h b/src/game/Formulas.h index c4cdb4a75..b00c2db3e 100644 --- a/src/game/Formulas.h +++ b/src/game/Formulas.h @@ -106,7 +106,7 @@ namespace MaNGOS pCreature->GetCreatureInfo()->type != CREATURE_TYPE_CRITTER && pCreature->GetCreatureInfo()->type != CREATURE_TYPE_NOT_SPECIFIED && pCreature->GetCreatureInfo()->type != CREATURE_TYPE_TOTEM && - pCreature->GetCreatureInfo()->minhealth > 50; + pCreature->GetCreatureInfo()->health_min > 50; if (pCreature->GetUInt32Value(UNIT_CREATED_BY_SPELL) && !isPet) return 0; @@ -127,7 +127,7 @@ namespace MaNGOS if (isPet) xp_gain *= 0.75f; - xp_gain *= pCreature->GetCreatureInfo()->ExperienceMultiplier; + xp_gain *= pCreature->GetCreatureInfo()->xp_multiplier; xp_gain *= pCreature->GetXPModifierDueToDamageOrigin(); return (uint32)(xp_gain*sWorld.getConfig(CONFIG_FLOAT_RATE_XP_KILL)); @@ -142,7 +142,7 @@ namespace MaNGOS ((Creature*)u)->GetCreatureInfo()->type != CREATURE_TYPE_CRITTER && ((Creature*)u)->GetCreatureInfo()->type != CREATURE_TYPE_NOT_SPECIFIED && ((Creature*)u)->GetCreatureInfo()->type != CREATURE_TYPE_TOTEM && - ((Creature*)u)->GetCreatureInfo()->minhealth > 50; + ((Creature*)u)->GetCreatureInfo()->health_min > 50; if(u->GetTypeId()==TYPEID_UNIT && ( (u->GetUInt32Value(UNIT_CREATED_BY_SPELL) && !isPet) || diff --git a/src/game/Group/CreatureLinkingMgr.cpp b/src/game/Group/CreatureLinkingMgr.cpp index f38fffb0a..96d9b4522 100644 --- a/src/game/Group/CreatureLinkingMgr.cpp +++ b/src/game/Group/CreatureLinkingMgr.cpp @@ -457,7 +457,7 @@ void CreatureLinkingHolder::DoCreatureLinkingEvent(CreatureLinkingEvent eventTyp { CreatureData const* masterData = sObjectMgr.GetCreatureData(pInfo->masterDBGuid); CreatureInfo const* cInfo = ObjectMgr::GetCreatureTemplate(masterData->id); - pMaster = pSource->GetMap()->GetCreature(ObjectGuid(cInfo->GetHighGuid(), cInfo->Entry, pInfo->masterDBGuid)); + pMaster = pSource->GetMap()->GetCreature(ObjectGuid(cInfo->GetHighGuid(), cInfo->entry, pInfo->masterDBGuid)); } if (pMaster) @@ -729,7 +729,7 @@ bool CreatureLinkingHolder::TryFollowMaster(Creature* pCreature) { CreatureData const* masterData = sObjectMgr.GetCreatureData(pInfo->masterDBGuid); CreatureInfo const* cInfo = ObjectMgr::GetCreatureTemplate(masterData->id); - pMaster = pCreature->GetMap()->GetCreature(ObjectGuid(cInfo->GetHighGuid(), cInfo->Entry, pInfo->masterDBGuid)); + pMaster = pCreature->GetMap()->GetCreature(ObjectGuid(cInfo->GetHighGuid(), cInfo->entry, pInfo->masterDBGuid)); } if (pMaster && pMaster->isAlive()) diff --git a/src/game/Handlers/NPCHandler.cpp b/src/game/Handlers/NPCHandler.cpp index 3d672b603..28d5ffa28 100644 --- a/src/game/Handlers/NPCHandler.cpp +++ b/src/game/Handlers/NPCHandler.cpp @@ -383,7 +383,7 @@ void WorldSession::HandleGossipHelloOpcode(WorldPacket & recv_data) if (!sScriptMgr.OnGossipHello(_player, pCreature)) { - _player->PrepareGossipMenu(pCreature, pCreature->GetCreatureInfo()->GossipMenuId); + _player->PrepareGossipMenu(pCreature, pCreature->GetCreatureInfo()->gossip_menu_id); _player->SendPreparedGossip(pCreature); } } diff --git a/src/game/Handlers/QueryHandler.cpp b/src/game/Handlers/QueryHandler.cpp index 6cb753303..b04369672 100644 --- a/src/game/Handlers/QueryHandler.cpp +++ b/src/game/Handlers/QueryHandler.cpp @@ -173,8 +173,8 @@ void WorldSession::HandleCreatureQueryOpcode(WorldPacket & recv_data) { std::string Name, SubName; - Name = ci->Name; - SubName = ci->SubName; + Name = ci->name; + SubName = ci->subname; int loc_idx = GetSessionDbLocaleIndex(); if (loc_idx >= 0) @@ -188,7 +188,7 @@ void WorldSession::HandleCreatureQueryOpcode(WorldPacket & recv_data) SubName = cl->SubName[loc_idx]; } } - DETAIL_LOG("WORLD: CMSG_CREATURE_QUERY '%s' - Entry: %u.", ci->Name, entry); + DETAIL_LOG("WORLD: CMSG_CREATURE_QUERY '%s' - Entry: %u.", ci->name, entry); // guess size WorldPacket data(SMSG_CREATURE_QUERY_RESPONSE, 100); data << uint32(entry); // creature entry @@ -196,19 +196,19 @@ void WorldSession::HandleCreatureQueryOpcode(WorldPacket & recv_data) data << uint8(0) << uint8(0) << uint8(0); // name2, name3, name4, always empty data << SubName; data << uint32(ci->type_flags); // flags - data << uint32(ci->type); // Nostalrius : fix pets des chasseurs non consideres comme betes. + data << uint32(ci->type); - data << uint32(ci->family); // CreatureFamily.dbc + data << uint32(ci->beast_family); // CreatureFamily.dbc data << uint32(ci->rank); // Creature Rank (elite, boss, etc) data << uint32(0); // unknown wdbFeild11 - data << uint32(ci->PetSpellDataId); // Id from CreatureSpellData.dbc wdbField12 + data << uint32(ci->pet_spell_list_id); // Id from CreatureSpellData.dbc wdbField12 if (unit) data << unit->GetUInt32Value(UNIT_FIELD_DISPLAYID); //DisplayID wdbFeild13 else data << uint32(Creature::ChooseDisplayId(ci)); // workaround, way to manage models must be fixed data << uint8(ci->civilian); //wdbFeild14 - data << uint8(ci->RacialLeader); + data << uint8(ci->racial_leader); SendPacket(&data); DEBUG_LOG("WORLD: Sent SMSG_CREATURE_QUERY_RESPONSE"); } diff --git a/src/game/Handlers/QuestHandler.cpp b/src/game/Handlers/QuestHandler.cpp index 81aa347bc..f02fa50a7 100644 --- a/src/game/Handlers/QuestHandler.cpp +++ b/src/game/Handlers/QuestHandler.cpp @@ -106,7 +106,7 @@ void WorldSession::HandleQuestgiverHelloOpcode(WorldPacket & recv_data) if (sScriptMgr.OnGossipHello(_player, pCreature)) return; - _player->PrepareGossipMenu(pCreature, pCreature->GetCreatureInfo()->GossipMenuId); + _player->PrepareGossipMenu(pCreature, pCreature->GetCreatureInfo()->gossip_menu_id); _player->SendPreparedGossip(pCreature); } diff --git a/src/game/LootMgr.cpp b/src/game/LootMgr.cpp index e2395185b..354c662c6 100644 --- a/src/game/LootMgr.cpp +++ b/src/game/LootMgr.cpp @@ -1350,7 +1350,7 @@ void LoadLootTemplates_Creature() { if (CreatureInfo const* cInfo = sCreatureStorage.LookupEntry(i)) { - if (uint32 lootid = cInfo->lootid) + if (uint32 lootid = cInfo->loot_id) { if (ids_set.find(lootid) == ids_set.end()) LootTemplates_Creature.ReportNotExistedId(lootid); @@ -1469,7 +1469,7 @@ void LoadLootTemplates_Pickpocketing() { if (CreatureInfo const* cInfo = sCreatureStorage.LookupEntry(i)) { - if (uint32 lootid = cInfo->pickpocketLootId) + if (uint32 lootid = cInfo->pickpocket_loot_id) { if (ids_set.find(lootid) == ids_set.end()) LootTemplates_Pickpocketing.ReportNotExistedId(lootid); @@ -1511,7 +1511,7 @@ void LoadLootTemplates_Skinning() { if (CreatureInfo const* cInfo = sCreatureStorage.LookupEntry(i)) { - if (uint32 lootid = cInfo->SkinLootId) + if (uint32 lootid = cInfo->skinning_loot_id) { if (ids_set.find(lootid) == ids_set.end()) LootTemplates_Skinning.ReportNotExistedId(lootid); diff --git a/src/game/Maps/Map.cpp b/src/game/Maps/Map.cpp index 9a768a175..adbc08a77 100644 --- a/src/game/Maps/Map.cpp +++ b/src/game/Maps/Map.cpp @@ -3050,7 +3050,7 @@ public: std::string nameForLocale = ""; if (loc_idx >= 0) { - CreatureLocale const *cl = sObjectMgr.GetCreatureLocale(i_cInfo->Entry); + CreatureLocale const *cl = sObjectMgr.GetCreatureLocale(i_cInfo->entry); if (cl) { if (cl->Name.size() > (size_t)loc_idx && !cl->Name[loc_idx].empty()) @@ -3059,7 +3059,7 @@ public: } if (nameForLocale.empty()) - nameForLocale = i_cInfo->Name; + nameForLocale = i_cInfo->name; ChatHandler::BuildChatPacket(data, i_msgtype, text, i_language, CHAT_TAG_NONE, i_senderGuid, nameForLocale.c_str(), i_target ? i_target->GetObjectGuid() : ObjectGuid(), i_target ? i_target->GetNameForLocaleIdx(loc_idx) : ""); diff --git a/src/game/Maps/ScriptCommands.cpp b/src/game/Maps/ScriptCommands.cpp index 70c7e6f61..31dbc3a0a 100644 --- a/src/game/Maps/ScriptCommands.cpp +++ b/src/game/Maps/ScriptCommands.cpp @@ -661,7 +661,7 @@ bool Map::ScriptCommand_SetEquipment(const ScriptInfo& script, WorldObject* sour if (script.setEquipment.resetDefault) { - pSource->LoadEquipment(pSource->GetCreatureInfo()->equipmentId, true); + pSource->LoadEquipment(pSource->GetCreatureInfo()->equipment_id, true); return false; } @@ -1558,7 +1558,7 @@ bool Map::ScriptCommand_CreatureSpells(const ScriptInfo& script, WorldObject* so for (int i = 0; i < 4; i++) { - const uint32 currentId = script.creatureSpells.spellTemplate[i]; + const uint32 currentId = script.creatureSpells.spellListId[i]; const uint32 currentChance = script.creatureSpells.chance[i]; if (!currentChance) @@ -1574,7 +1574,7 @@ bool Map::ScriptCommand_CreatureSpells(const ScriptInfo& script, WorldObject* so } if (pSource->AI()) - pSource->AI()->SetSpellsTemplate(chosenId); + pSource->AI()->SetSpellsList(chosenId); else return ShouldAbortScript(script); diff --git a/src/game/Movement/PointMovementGenerator.cpp b/src/game/Movement/PointMovementGenerator.cpp index d91c2fe93..036396892 100644 --- a/src/game/Movement/PointMovementGenerator.cpp +++ b/src/game/Movement/PointMovementGenerator.cpp @@ -165,7 +165,7 @@ bool DistancingMovementGenerator::Update(Creature &unit, const uint32 &diff) void DistancingMovementGenerator::MovementInform(Creature &unit) { if (unit.AI()) - unit.AI()->DoSpellTemplateCasts(1); + unit.AI()->DoSpellsListCasts(1); } void AssistanceMovementGenerator::Initialize(Creature& unit) diff --git a/src/game/Movement/WaypointManager.cpp b/src/game/Movement/WaypointManager.cpp index 0c4c6002a..c555c525a 100644 --- a/src/game/Movement/WaypointManager.cpp +++ b/src/game/Movement/WaypointManager.cpp @@ -229,7 +229,7 @@ void WaypointManager::Load() sLog.outErrorDb("Table creature_movement has waypoint for creature guid %u (entry %u), but MovementType is not WAYPOINT_MOTION_TYPE(2). Creature will not use this path.", *itr, cData->id); - if (cInfo->MovementType == WAYPOINT_MOTION_TYPE) + if (cInfo->movement_type == WAYPOINT_MOTION_TYPE) sLog.outErrorDb(" creature_template for this entry has MovementType WAYPOINT_MOTION_TYPE(2), did you intend to use creature_movement_template ?"); } } diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index 53ba0ff5e..331d069ba 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -1147,111 +1147,98 @@ void ObjectMgr::CheckCreatureTemplates() FactionTemplateEntry const* factionTemplate = GetFactionTemplateEntry(cInfo->faction); if (!factionTemplate) - sLog.outErrorDb("Creature (Entry: %u) has nonexistent faction template (%u)", cInfo->Entry, cInfo->faction); - - for (int k = 0; k < MAX_KILL_CREDIT; ++k) - { - if (cInfo->KillCredit[k]) - { - if (!GetCreatureTemplate(cInfo->KillCredit[k])) - { - sLog.outErrorDb("Creature (Entry: %u) has nonexistent creature entry in `KillCredit%d` (%u)", cInfo->Entry, k + 1, cInfo->KillCredit[k]); - sLog.out(LOG_DBERRFIX, "UPDATE creature_template SET `KillCredit%d`=0 WHERE entry=%u;", k + 1, cInfo->Entry); - const_cast(cInfo)->KillCredit[k] = 0; - } - } - } + sLog.outErrorDb("Creature (Entry: %u) has nonexistent faction template (%u)", cInfo->entry, cInfo->faction); // used later for scale CreatureDisplayInfoEntry const* displayScaleEntry = nullptr; for (int i = 0; i < MAX_CREATURE_MODEL; ++i) { - if (cInfo->ModelId[i]) + if (cInfo->display_id[i]) { - CreatureDisplayInfoEntry const* displayEntry = sCreatureDisplayInfoStore.LookupEntry(cInfo->ModelId[i]); + CreatureDisplayInfoEntry const* displayEntry = sCreatureDisplayInfoStore.LookupEntry(cInfo->display_id[i]); if (!displayEntry) { - sLog.outErrorDb("Creature (Entry: %u) has nonexistent modelid_%d (%u), can crash client", cInfo->Entry, i + 1, cInfo->ModelId[i]); - sLog.out(LOG_DBERRFIX, "UPDATE creature_template SET `modelid_%d`=0 WHERE entry=%u;", i + 1, cInfo->Entry); - const_cast(cInfo)->ModelId[i] = 0; + sLog.outErrorDb("Creature (Entry: %u) has nonexistent modelid_%d (%u), can crash client", cInfo->entry, i + 1, cInfo->display_id[i]); + sLog.out(LOG_DBERRFIX, "UPDATE creature_template SET `modelid_%d`=0 WHERE entry=%u;", i + 1, cInfo->entry); + const_cast(cInfo)->display_id[i] = 0; } else if (!displayScaleEntry) displayScaleEntry = displayEntry; - CreatureModelInfo const* minfo = sCreatureModelStorage.LookupEntry(cInfo->ModelId[i]); + CreatureModelInfo const* minfo = sCreatureModelStorage.LookupEntry(cInfo->display_id[i]); if (!minfo) - sLog.outErrorDb("Creature (Entry: %u) are using modelid_%d (%u), but creature_model_info are missing for this model.", cInfo->Entry, i + 1, cInfo->ModelId[i]); + sLog.outErrorDb("Creature (Entry: %u) are using modelid_%d (%u), but creature_model_info are missing for this model.", cInfo->entry, i + 1, cInfo->display_id[i]); } } if (!displayScaleEntry) - sLog.outErrorDb("Creature (Entry: %u) has nonexistent modelid in modelid_1/modelid_2", cInfo->Entry); + sLog.outErrorDb("Creature (Entry: %u) has nonexistent modelid in modelid_1/modelid_2", cInfo->entry); // use below code for 0-checks for unit_class if (!cInfo->unit_class) - ERROR_DB_STRICT_LOG("Creature (Entry: %u) not has proper unit_class(%u) for creature_template", cInfo->Entry, cInfo->unit_class); + ERROR_DB_STRICT_LOG("Creature (Entry: %u) not has proper unit_class(%u) for creature_template", cInfo->entry, cInfo->unit_class); else if (((1 << (cInfo->unit_class - 1)) & CLASSMASK_ALL_CREATURES) == 0) - sLog.outErrorDb("Creature (Entry: %u) has invalid unit_class(%u) for creature_template", cInfo->Entry, cInfo->unit_class); + sLog.outErrorDb("Creature (Entry: %u) has invalid unit_class(%u) for creature_template", cInfo->entry, cInfo->unit_class); - if (cInfo->dmgschool >= MAX_SPELL_SCHOOL) + if (cInfo->dmg_school >= MAX_SPELL_SCHOOL) { - sLog.outErrorDb("Creature (Entry: %u) has invalid spell school value (%u) in `dmgschool`", cInfo->Entry, cInfo->dmgschool); - sLog.out(LOG_DBERRFIX, "UPDATE creature_template SET `dmgschool`=%u WHERE entry=%u;", SPELL_SCHOOL_NORMAL, cInfo->Entry); - const_cast(cInfo)->dmgschool = SPELL_SCHOOL_NORMAL; + sLog.outErrorDb("Creature (Entry: %u) has invalid spell school value (%u) in `dmgschool`", cInfo->entry, cInfo->dmg_school); + sLog.out(LOG_DBERRFIX, "UPDATE creature_template SET `dmgschool`=%u WHERE entry=%u;", SPELL_SCHOOL_NORMAL, cInfo->entry); + const_cast(cInfo)->dmg_school = SPELL_SCHOOL_NORMAL; } - if (cInfo->baseattacktime == 0) + if (cInfo->base_attack_time == 0) { - sLog.out(LOG_DBERRFIX, "UPDATE creature_template SET `baseattacktime`=%u WHERE entry=%u;", BASE_ATTACK_TIME, cInfo->Entry); - const_cast(cInfo)->baseattacktime = BASE_ATTACK_TIME; + sLog.out(LOG_DBERRFIX, "UPDATE creature_template SET `base_attack_time`=%u WHERE entry=%u;", BASE_ATTACK_TIME, cInfo->entry); + const_cast(cInfo)->base_attack_time = BASE_ATTACK_TIME; } - if (cInfo->rangeattacktime == 0) + if (cInfo->ranged_attack_time == 0) { - sLog.out(LOG_DBERRFIX, "UPDATE creature_template SET `rangeattacktime`=%u WHERE entry=%u;", BASE_ATTACK_TIME, cInfo->Entry); - const_cast(cInfo)->rangeattacktime = BASE_ATTACK_TIME; + sLog.out(LOG_DBERRFIX, "UPDATE creature_template SET `ranged_attack_time`=%u WHERE entry=%u;", BASE_ATTACK_TIME, cInfo->entry); + const_cast(cInfo)->ranged_attack_time = BASE_ATTACK_TIME; } - if ((cInfo->npcflag & UNIT_NPC_FLAG_TRAINER) && cInfo->trainer_type >= MAX_TRAINER_TYPE) - sLog.outErrorDb("Creature (Entry: %u) has wrong trainer type %u", cInfo->Entry, cInfo->trainer_type); + if ((cInfo->npc_flags & UNIT_NPC_FLAG_TRAINER) && cInfo->trainer_type >= MAX_TRAINER_TYPE) + sLog.outErrorDb("Creature (Entry: %u) has wrong trainer type %u", cInfo->entry, cInfo->trainer_type); if (cInfo->type && !sCreatureTypeStore.LookupEntry(cInfo->type)) { - sLog.outErrorDb("Creature (Entry: %u) has invalid creature type (%u) in `type`", cInfo->Entry, cInfo->type); - sLog.out(LOG_DBERRFIX, "UPDATE creature_template SET `type`=%u WHERE entry=%u;", CREATURE_TYPE_HUMANOID, cInfo->Entry); + sLog.outErrorDb("Creature (Entry: %u) has invalid creature type (%u) in `type`", cInfo->entry, cInfo->type); + sLog.out(LOG_DBERRFIX, "UPDATE creature_template SET `type`=%u WHERE entry=%u;", CREATURE_TYPE_HUMANOID, cInfo->entry); const_cast(cInfo)->type = CREATURE_TYPE_HUMANOID; } // must exist or used hidden but used in data horse case - if (cInfo->family && !sCreatureFamilyStore.LookupEntry(cInfo->family) && cInfo->family != CREATURE_FAMILY_HORSE_CUSTOM) + if (cInfo->beast_family && !sCreatureFamilyStore.LookupEntry(cInfo->beast_family) && cInfo->beast_family != CREATURE_FAMILY_HORSE_CUSTOM) { - sLog.outErrorDb("Creature (Entry: %u) has invalid creature family (%u) in `family`", cInfo->Entry, cInfo->family); - sLog.out(LOG_DBERRFIX, "UPDATE creature_template SET `family`=%u WHERE entry=%u;", 0, cInfo->Entry); - const_cast(cInfo)->family = 0; + sLog.outErrorDb("Creature (Entry: %u) has invalid creature family (%u) in `family`", cInfo->entry, cInfo->beast_family); + sLog.out(LOG_DBERRFIX, "UPDATE creature_template SET `family`=%u WHERE entry=%u;", 0, cInfo->entry); + const_cast(cInfo)->beast_family = 0; } - if (cInfo->InhabitType <= 0 || cInfo->InhabitType > INHABIT_ANYWHERE) + if (cInfo->inhabit_type <= 0 || cInfo->inhabit_type > INHABIT_ANYWHERE) { - sLog.outErrorDb("Creature (Entry: %u) has wrong value (%u) in `InhabitType`, creature will not correctly walk/swim", cInfo->Entry, cInfo->InhabitType); - sLog.out(LOG_DBERRFIX, "UPDATE creature_template SET `InhabitType`=%u WHERE entry=%u;", INHABIT_ANYWHERE, cInfo->Entry); - const_cast(cInfo)->InhabitType = INHABIT_ANYWHERE; + sLog.outErrorDb("Creature (Entry: %u) has wrong value (%u) in `InhabitType`, creature will not correctly walk/swim", cInfo->entry, cInfo->inhabit_type); + sLog.out(LOG_DBERRFIX, "UPDATE creature_template SET `InhabitType`=%u WHERE entry=%u;", INHABIT_ANYWHERE, cInfo->entry); + const_cast(cInfo)->inhabit_type = INHABIT_ANYWHERE; } - if (cInfo->PetSpellDataId) + if (cInfo->pet_spell_list_id) { - CreatureSpellDataEntry const* spellDataId = sCreatureSpellDataStore.LookupEntry(cInfo->PetSpellDataId); + CreatureSpellDataEntry const* spellDataId = sCreatureSpellDataStore.LookupEntry(cInfo->pet_spell_list_id); if (!spellDataId) - sLog.outErrorDb("Creature (Entry: %u) has non-existing PetSpellDataId (%u)", cInfo->Entry, cInfo->PetSpellDataId); + sLog.outErrorDb("Creature (Entry: %u) has non-existing pet_spell_list_id (%u)", cInfo->entry, cInfo->pet_spell_list_id); } - if (cInfo->spells_template) + if (cInfo->spell_list_id) { - CreatureSpellsTemplate const* spellsTemplate = GetCreatureSpellsTemplate((cInfo->spells_template)); - if (!spellsTemplate) + CreatureSpellsList const* spellsList = GetCreatureSpellsList((cInfo->spell_list_id)); + if (!spellsList) { - sLog.outErrorDb("Creature (Entry: %u) has non-existing spells template (%u)", cInfo->Entry, cInfo->spells_template); - const_cast(cInfo)->spells_template = 0; + sLog.outErrorDb("Creature (Entry: %u) has non-existing spells template (%u)", cInfo->entry, cInfo->spell_list_id); + const_cast(cInfo)->spell_list_id = 0; } } @@ -1259,33 +1246,33 @@ void ObjectMgr::CheckCreatureTemplates() { if (cInfo->spells[j] && !sSpellMgr.GetSpellEntry(cInfo->spells[j])) { - sLog.outErrorDb("Creature (Entry: %u) has non-existing Spell%d (%u), set to 0", cInfo->Entry, j + 1, cInfo->spells[j]); - sLog.out(LOG_DBERRFIX, "UPDATE creature_template SET `spell%u`=0 WHERE entry=%u;", j + 1, cInfo->Entry); + sLog.outErrorDb("Creature (Entry: %u) has non-existing Spell%d (%u), set to 0", cInfo->entry, j + 1, cInfo->spells[j]); + sLog.out(LOG_DBERRFIX, "UPDATE creature_template SET `spell%u`=0 WHERE entry=%u;", j + 1, cInfo->entry); const_cast(cInfo)->spells[j] = 0; } } - if (cInfo->MovementType >= MAX_DB_MOTION_TYPE) + if (cInfo->movement_type >= MAX_DB_MOTION_TYPE) { - sLog.outErrorDb("Creature (Entry: %u) has wrong movement generator type (%u), ignore and set to IDLE.", cInfo->Entry, cInfo->MovementType); - sLog.out(LOG_DBERRFIX, "UPDATE creature_template SET `MovementType`=%u WHERE entry=%u;", IDLE_MOTION_TYPE, cInfo->Entry); - const_cast(cInfo)->MovementType = IDLE_MOTION_TYPE; + sLog.outErrorDb("Creature (Entry: %u) has wrong movement generator type (%u), ignore and set to IDLE.", cInfo->entry, cInfo->movement_type); + sLog.out(LOG_DBERRFIX, "UPDATE creature_template SET `MovementType`=%u WHERE entry=%u;", IDLE_MOTION_TYPE, cInfo->entry); + const_cast(cInfo)->movement_type = IDLE_MOTION_TYPE; } - if (cInfo->equipmentId > 0) // 0 no equipment + if (cInfo->equipment_id > 0) // 0 no equipment { - if (!GetEquipmentInfo(cInfo->equipmentId)) + if (!GetEquipmentInfo(cInfo->equipment_id)) { - sLog.outErrorDb("Table `creature_template` have creature (Entry: %u) with equipment_id %u not found in table `creature_equip_template`, set to no equipment.", cInfo->Entry, cInfo->equipmentId); - sLog.out(LOG_DBERRFIX, "UPDATE creature_template SET `equipment_id`=0 WHERE entry=%u;", cInfo->Entry); - const_cast(cInfo)->equipmentId = 0; + sLog.outErrorDb("Table `creature_template` have creature (Entry: %u) with equipment_id %u not found in table `creature_equip_template`, set to no equipment.", cInfo->entry, cInfo->equipment_id); + sLog.out(LOG_DBERRFIX, "UPDATE creature_template SET `equipment_id`=0 WHERE entry=%u;", cInfo->entry); + const_cast(cInfo)->equipment_id = 0; } } - if (cInfo->vendorId > 0) + if (cInfo->vendor_id > 0) { - if (!(cInfo->npcflag & UNIT_NPC_FLAG_VENDOR)) - sLog.outErrorDb("Table `creature_template` have creature (Entry: %u) with vendor_id %u but not have flag UNIT_NPC_FLAG_VENDOR (%u), vendor items will ignored.", cInfo->Entry, cInfo->vendorId, UNIT_NPC_FLAG_VENDOR); + if (!(cInfo->npc_flags & UNIT_NPC_FLAG_VENDOR)) + sLog.outErrorDb("Table `creature_template` have creature (Entry: %u) with vendor_id %u but not have flag UNIT_NPC_FLAG_VENDOR (%u), vendor items will ignored.", cInfo->entry, cInfo->vendor_id, UNIT_NPC_FLAG_VENDOR); } /// if not set custom creature scale then load scale from CreatureDisplayInfo.dbc @@ -1297,35 +1284,35 @@ void ObjectMgr::CheckCreatureTemplates() const_cast(cInfo)->scale = DEFAULT_OBJECT_SCALE; } - if (cInfo->ExperienceMultiplier < 0.0f) + if (cInfo->xp_multiplier < 0.0f) { - sLog.outErrorDb("Creature (Entry: %u) has negative experience multiplier (%f)", cInfo->Entry, cInfo->ExperienceMultiplier); - const_cast(cInfo)->ExperienceMultiplier = 1.0f; + sLog.outErrorDb("Creature (Entry: %u) has negative experience multiplier (%f)", cInfo->entry, cInfo->xp_multiplier); + const_cast(cInfo)->xp_multiplier = 1.0f; } - if (cInfo->Detection < 0.0f) + if (cInfo->detection_range < 0.0f) { - sLog.outErrorDb("Creature (Entry: %u) has negative detection distance (%f)", cInfo->Entry, cInfo->Detection); - const_cast(cInfo)->Detection = 20.0f; + sLog.outErrorDb("Creature (Entry: %u) has negative detection distance (%f)", cInfo->entry, cInfo->detection_range); + const_cast(cInfo)->detection_range = 20.0f; } - if (cInfo->CallForHelp < 0.0f) + if (cInfo->call_for_help_range < 0.0f) { - sLog.outErrorDb("Creature (Entry: %u) has negative call for help radius (%f)", cInfo->Entry, cInfo->CallForHelp); - const_cast(cInfo)->CallForHelp = 5.0f; + sLog.outErrorDb("Creature (Entry: %u) has negative call for help radius (%f)", cInfo->entry, cInfo->call_for_help_range); + const_cast(cInfo)->call_for_help_range = 5.0f; } - if (cInfo->Leash) + if (cInfo->leash_range) { - if (cInfo->Leash < 0.0f) + if (cInfo->leash_range < 0.0f) { - sLog.outErrorDb("Creature (Entry: %u) has negative leash distance (%f)", cInfo->Entry, cInfo->Leash); - const_cast(cInfo)->Leash = 0.0f; + sLog.outErrorDb("Creature (Entry: %u) has negative leash distance (%f)", cInfo->entry, cInfo->leash_range); + const_cast(cInfo)->leash_range = 0.0f; } - else if (cInfo->Leash < cInfo->Detection) + else if (cInfo->leash_range < cInfo->detection_range) { - sLog.outErrorDb("Creature (Entry: %u) has leash distance below detection distance (%f)", cInfo->Entry, cInfo->Leash); - const_cast(cInfo)->Leash = 0.0f; + sLog.outErrorDb("Creature (Entry: %u) has leash distance below detection distance (%f)", cInfo->entry, cInfo->leash_range); + const_cast(cInfo)->leash_range = 0.0f; } } } @@ -1701,7 +1688,7 @@ void ObjectMgr::LoadCreatureSpells() uint32 entry = fields[0].GetUInt32();; - CreatureSpellsTemplate spellsTemplate; + CreatureSpellsList spellsList; for (uint8 i = 0; i < CREATURE_SPELLS_MAX_SPELLS; i++) { @@ -1762,12 +1749,12 @@ void ObjectMgr::LoadCreatureSpells() spellScriptSet.erase(scriptId); } - spellsTemplate.emplace_back(spellId, probability, castTarget, targetParam1, targetParam2, castFlags, delayInitialMin, delayInitialMax, delayRepeatMin, delayRepeatMax, scriptId); + spellsList.emplace_back(spellId, probability, castTarget, targetParam1, targetParam2, castFlags, delayInitialMin, delayInitialMax, delayRepeatMin, delayRepeatMax, scriptId); } } - if (!spellsTemplate.empty()) - m_CreatureSpellsMap.insert(CreatureSpellsMap::value_type(entry, spellsTemplate)); + if (!spellsList.empty()) + m_CreatureSpellsMap.insert(CreatureSpellsMap::value_type(entry, spellsList)); } while (result->NextRow()); @@ -1899,11 +1886,11 @@ void ObjectMgr::LoadCreatures(bool reload) } } - if (cInfo->RegenHealth && data.curhealth < cInfo->minhealth) + if (cInfo->regeneration && data.curhealth < cInfo->health_min) { - sLog.outErrorDb("Table `creature` have creature (GUID: %u Entry: %u) with `creature_template`.`RegenHealth`=1 and low current health (%u), `creature_template`.`minhealth`=%u.", guid, data.id, data.curhealth, cInfo->minhealth); - sLog.out(LOG_DBERRFIX, "UPDATE creature SET curhealth=%u WHERE guid=%u AND id=%u;", cInfo->minhealth, guid, data.id); - data.curhealth = cInfo->minhealth; + sLog.outErrorDb("Table `creature` have creature (GUID: %u Entry: %u) with `creature_template`.`RegenHealth`=1 and low current health (%u), `creature_template`.`minhealth`=%u.", guid, data.id, data.curhealth, cInfo->health_min); + sLog.out(LOG_DBERRFIX, "UPDATE creature SET curhealth=%u WHERE guid=%u AND id=%u;", cInfo->health_min, guid, data.id); + data.curhealth = cInfo->health_min; } if (cInfo->flags_extra & CREATURE_FLAG_EXTRA_INSTANCE_BIND) @@ -1920,11 +1907,11 @@ void ObjectMgr::LoadCreatures(bool reload) guid, data.id, CREATURE_FLAG_EXTRA_AGGRO_ZONE); } - if (data.curmana < cInfo->minmana) + if (data.curmana < cInfo->mana_min) { - sLog.outErrorDb("Table `creature` have creature (GUID: %u Entry: %u) with low current mana (%u), `creature_template`.`minmana`=%u.", guid, data.id, data.curmana, cInfo->minmana); - sLog.out(LOG_DBERRFIX, "UPDATE creature SET curmana=%u WHERE guid=%u AND id=%u;", cInfo->minmana, guid, data.id); - data.curmana = cInfo->minmana; + sLog.outErrorDb("Table `creature` have creature (GUID: %u Entry: %u) with low current mana (%u), `creature_template`.`minmana`=%u.", guid, data.id, data.curmana, cInfo->mana_min); + sLog.out(LOG_DBERRFIX, "UPDATE creature SET curmana=%u WHERE guid=%u AND id=%u;", cInfo->mana_min, guid, data.id); + data.curmana = cInfo->mana_min; } if (data.spawndist < 0.0f) @@ -5430,9 +5417,9 @@ void ObjectMgr::LoadPetCreateSpells() continue; } - if (CreatureSpellDataEntry const* petSpellEntry = cInfo->PetSpellDataId ? sCreatureSpellDataStore.LookupEntry(cInfo->PetSpellDataId) : nullptr) + if (CreatureSpellDataEntry const* petSpellEntry = cInfo->pet_spell_list_id ? sCreatureSpellDataStore.LookupEntry(cInfo->pet_spell_list_id) : nullptr) { - sLog.outErrorDb("Creature id %u listed in `petcreateinfo_spell` have set `PetSpellDataId` field and will use its instead, skip.", creature_id); + sLog.outErrorDb("Creature id %u listed in `petcreateinfo_spell` have set `pet_spell_list_id` field and will use its instead, skip.", creature_id); continue; } @@ -5499,7 +5486,7 @@ void ObjectMgr::LoadPetCreateSpells() if (!cInfo) continue; - CreatureSpellDataEntry const* petSpellEntry = cInfo->PetSpellDataId ? sCreatureSpellDataStore.LookupEntry(cInfo->PetSpellDataId) : nullptr; + CreatureSpellDataEntry const* petSpellEntry = cInfo->pet_spell_list_id ? sCreatureSpellDataStore.LookupEntry(cInfo->pet_spell_list_id) : nullptr; if (!petSpellEntry) continue; @@ -7275,9 +7262,9 @@ std::string ObjectMgr::GeneratePetName(uint32 entry) if (list0.empty() || list1.empty()) { CreatureInfo const *cinfo = GetCreatureTemplate(entry); - char const* petname = GetPetName(cinfo->family, sWorld.GetDefaultDbcLocale()); + char const* petname = GetPetName(cinfo->beast_family, sWorld.GetDefaultDbcLocale()); if (!petname) - petname = cinfo->Name; + petname = cinfo->name; return std::string(petname); } @@ -7872,8 +7859,8 @@ void ObjectMgr::LoadCreatureQuestRelations() CreatureInfo const* cInfo = GetCreatureTemplate(itr->first); if (!cInfo) sLog.outErrorDb("Table `creature_questrelation` have data for nonexistent creature entry (%u) and existing quest %u", itr->first, itr->second); - else if (!(cInfo->npcflag & UNIT_NPC_FLAG_QUESTGIVER)) - sLog.outDetail("Table `creature_questrelation` has creature entry (%u) for quest %u, but npcflag does not include UNIT_NPC_FLAG_QUESTGIVER", itr->first, itr->second); + else if (!(cInfo->npc_flags & UNIT_NPC_FLAG_QUESTGIVER)) + sLog.outDetail("Table `creature_questrelation` has creature entry (%u) for quest %u, but npc_flags does not include UNIT_NPC_FLAG_QUESTGIVER", itr->first, itr->second); } } @@ -7886,8 +7873,8 @@ void ObjectMgr::LoadCreatureInvolvedRelations() CreatureInfo const* cInfo = GetCreatureTemplate(itr->first); if (!cInfo) sLog.outErrorDb("Table `creature_involvedrelation` have data for nonexistent creature entry (%u) and existing quest %u", itr->first, itr->second); - else if (!(cInfo->npcflag & UNIT_NPC_FLAG_QUESTGIVER)) - sLog.outDetail("Table `creature_involvedrelation` has creature entry (%u) for quest %u, but npcflag does not include UNIT_NPC_FLAG_QUESTGIVER", itr->first, itr->second); + else if (!(cInfo->npc_flags & UNIT_NPC_FLAG_QUESTGIVER)) + sLog.outDetail("Table `creature_involvedrelation` has creature entry (%u) for quest %u, but npc_flags does not include UNIT_NPC_FLAG_QUESTGIVER", itr->first, itr->second); } } @@ -9263,7 +9250,7 @@ void ObjectMgr::LoadTrainers(char const* tableName, bool isTemplates) continue; } - if (!(cInfo->npcflag & UNIT_NPC_FLAG_TRAINER)) + if (!(cInfo->npc_flags & UNIT_NPC_FLAG_TRAINER)) { if (skip_trainers.find(entry) == skip_trainers.end()) { @@ -9273,11 +9260,11 @@ void ObjectMgr::LoadTrainers(char const* tableName, bool isTemplates) continue; } - if (TrainerSpellData const* tSpells = cInfo->trainerId ? GetNpcTrainerTemplateSpells(cInfo->trainerId) : nullptr) + if (TrainerSpellData const* tSpells = cInfo->trainer_id ? GetNpcTrainerTemplateSpells(cInfo->trainer_id) : nullptr) { if (tSpells->spellList.find(spell) != tSpells->spellList.end()) { - sLog.outErrorDb("Table `%s` (Entry: %u) has spell %u listed in trainer template %u, ignore", tableName, entry, spell, cInfo->trainerId); + sLog.outErrorDb("Table `%s` (Entry: %u) has spell %u listed in trainer template %u, ignore", tableName, entry, spell, cInfo->trainer_id); continue; } } @@ -9540,9 +9527,9 @@ void ObjectMgr::LoadGossipMenu() // post loading tests for (uint32 i = 1; i < sCreatureStorage.GetMaxEntry(); ++i) if (CreatureInfo const* cInfo = sCreatureStorage.LookupEntry(i)) - if (cInfo->GossipMenuId) - if (m_GossipMenusMap.find(cInfo->GossipMenuId) == m_GossipMenusMap.end()) - sLog.outErrorDb("Creature (Entry: %u) has gossip_menu_id = %u for nonexistent menu", cInfo->Entry, cInfo->GossipMenuId); + if (cInfo->gossip_menu_id) + if (m_GossipMenusMap.find(cInfo->gossip_menu_id) == m_GossipMenusMap.end()) + sLog.outErrorDb("Creature (Entry: %u) has gossip_menu_id = %u for nonexistent menu", cInfo->entry, cInfo->gossip_menu_id); for (auto itr = sGOStorage.begin(); itr < sGOStorage.end(); ++itr) if (uint32 menuid = itr->GetGossipMenuId()) @@ -9598,8 +9585,8 @@ void ObjectMgr::LoadGossipMenuItems() Menu2CInfoMap menu2CInfoMap; for (uint32 i = 1; i < sCreatureStorage.GetMaxEntry(); ++i) if (CreatureInfo const* cInfo = sCreatureStorage.LookupEntry(i)) - if (cInfo->GossipMenuId) - menu2CInfoMap.insert(Menu2CInfoMap::value_type(cInfo->GossipMenuId, cInfo)); + if (cInfo->gossip_menu_id) + menu2CInfoMap.insert(Menu2CInfoMap::value_type(cInfo->gossip_menu_id, cInfo)); do { @@ -9686,7 +9673,7 @@ void ObjectMgr::LoadGossipMenuItems() found_menu_uses = true; // some from creatures with gossip menu can use gossip option base at npc_flags - if (gMenuItem.npc_option_npcflag & cInfo->npcflag) + if (gMenuItem.npc_option_npcflag & cInfo->npc_flags) found_flags_uses = true; // unused check data preparing part @@ -9695,7 +9682,7 @@ void ObjectMgr::LoadGossipMenuItems() } if (found_menu_uses && !found_flags_uses) - sLog.outDetail("Table gossip_menu_option for menu %u, id %u has `npc_option_npcflag` = %u but creatures using this menu does not have corresponding`npcflag`. Option will not accessible in game.", gMenuItem.menu_id, gMenuItem.id, gMenuItem.npc_option_npcflag); + sLog.outDetail("Table gossip_menu_option for menu %u, id %u has `npc_option_npcflag` = %u but creatures using this menu does not have corresponding `npc_flags`. Option will not accessible in game.", gMenuItem.menu_id, gMenuItem.id, gMenuItem.npc_option_npcflag); } if (gMenuItem.action_poi_id && !GetPointOfInterest(gMenuItem.action_poi_id)) @@ -9790,7 +9777,7 @@ bool ObjectMgr::IsVendorItemValid(bool isTemplate, char const* tableName, uint32 return false; } - if (!(cInfo->npcflag & UNIT_NPC_FLAG_VENDOR)) + if (!(cInfo->npc_flags & UNIT_NPC_FLAG_VENDOR)) { if (!skip_vendors || skip_vendors->count(vendor_entry) == 0) { @@ -9861,12 +9848,12 @@ bool ObjectMgr::IsVendorItemValid(bool isTemplate, char const* tableName, uint32 ChatHandler(pl).PSendSysMessage(LANG_ITEM_ALREADY_IN_LIST, item_id); else { - if (!cInfo->vendorId) + if (!cInfo->vendor_id) sLog.outErrorDb("Table `%s` has duplicate items %u for %s %u, ignoring", tableName, item_id, idStr, vendor_entry); else sLog.outErrorDb("Table `%s` has duplicate items %u for %s %u (or possible in vendor template %u), ignoring", - tableName, item_id, idStr, vendor_entry, cInfo->vendorId); + tableName, item_id, idStr, vendor_entry, cInfo->vendor_id); } return false; } @@ -10114,13 +10101,13 @@ uint32 ObjectMgr::AddCreData(uint32 entry, uint32 /*team*/, uint32 mapId, float if (!map) return 0; - uint32 level = cInfo->minlevel == cInfo->maxlevel ? cInfo->minlevel : urand(cInfo->minlevel, cInfo->maxlevel); // Only used for extracting creature base stats + uint32 level = cInfo->level_min == cInfo->level_max ? cInfo->level_min : urand(cInfo->level_min, cInfo->level_max); // Only used for extracting creature base stats uint32 guid = map->GenerateLocalLowGuid(HIGHGUID_UNIT); CreatureData& data = NewOrExistCreatureData(guid); data.id = entry; data.mapid = mapId; - data.equipmentId = cInfo->equipmentId; + data.equipmentId = cInfo->equipment_id; data.posX = x; data.posY = y; data.posZ = z; @@ -10129,10 +10116,10 @@ uint32 ObjectMgr::AddCreData(uint32 entry, uint32 /*team*/, uint32 mapId, float data.spawntimesecsmax = spawntimedelay; data.spawndist = 0; data.currentwaypoint = 0; - data.curhealth = cInfo->maxhealth; - data.curmana = cInfo->maxmana; + data.curhealth = cInfo->health_max; + data.curmana = cInfo->mana_max; data.is_dead = false; - data.movementType = cInfo->MovementType; + data.movementType = cInfo->movement_type; AddCreatureToGrid(guid, &data); diff --git a/src/game/ObjectMgr.h b/src/game/ObjectMgr.h index 0f217ad40..8d4783c93 100644 --- a/src/game/ObjectMgr.h +++ b/src/game/ObjectMgr.h @@ -160,9 +160,9 @@ struct CreatureSpellsEntry CreatureSpellsEntry(uint16 Id, uint8 Probability, uint8 CastTarget, uint32 TargetParam1, uint32 TargetParam2, uint8 CastFlags, uint32 InitialMin, uint32 InitialMax, uint32 RepeatMin, uint32 RepeatMax, uint32 ScriptId) : spellId(Id), probability(Probability), castTarget(CastTarget), targetParam1(TargetParam1), targetParam2(TargetParam2), castFlags(CastFlags), delayInitialMin(InitialMin), delayInitialMax(InitialMax), delayRepeatMin(RepeatMin), delayRepeatMax(RepeatMax), scriptId(ScriptId) {} }; -typedef std::vector CreatureSpellsTemplate; +typedef std::vector CreatureSpellsList; -typedef std::unordered_map CreatureSpellsMap; +typedef std::unordered_map CreatureSpellsMap; typedef std::map CellCorpseSet; struct CellObjectGuids @@ -962,7 +962,7 @@ class ObjectMgr return &itr->second; } - CreatureSpellsTemplate const* GetCreatureSpellsTemplate(uint32 entry) const + CreatureSpellsList const* GetCreatureSpellsList(uint32 entry) const { auto itr = m_CreatureSpellsMap.find(entry); if (itr == m_CreatureSpellsMap.end()) return nullptr; diff --git a/src/game/Objects/Creature.cpp b/src/game/Objects/Creature.cpp index 8e47eb5d1..8dbf7c4b8 100644 --- a/src/game/Objects/Creature.cpp +++ b/src/game/Objects/Creature.cpp @@ -167,13 +167,13 @@ bool CreatureCreatePos::Relocate(Creature* cr) const Creature::Creature(CreatureSubtype subtype) : Unit(), i_AI(nullptr), loot(this), lootForPickPocketed(false), lootForBody(false), lootForSkin(false), skinningForOthersTimer(5000), m_TargetNotReachableTimer(0), - _pacifiedTimer(0), _manaRegen(true), m_manaRegen(0), + _pacifiedTimer(0), m_manaRegen(0), m_groupLootTimer(0), m_groupLootId(0), m_lootMoney(0), m_lootGroupRecipientId(0), m_corpseDecayTimer(0), m_respawnTime(0), m_respawnDelay(25), m_corpseDelay(60), m_respawnradius(5.0f), m_combatStartTime(0), m_combatState(false), m_combatResetCount(0), m_subtype(subtype), m_defaultMovementType(IDLE_MOTION_TYPE), m_equipmentId(0), m_AlreadyCallAssistance(false), m_AlreadySearchedAssistance(false), - m_regenHealth(true), m_AI_locked(false), m_isDeadByDefault(false), m_temporaryFactionFlags(TEMPFACTION_NONE), + m_bRegenHealth(true), m_bRegenMana(true), m_AI_locked(false), m_isDeadByDefault(false), m_temporaryFactionFlags(TEMPFACTION_NONE), m_meleeDamageSchoolMask(SPELL_SCHOOL_MASK_NORMAL), m_originalEntry(0), _creatureGroup(nullptr), m_combatStartX(0.0f), m_combatStartY(0.0f), m_combatStartZ(0.0f), m_HomeX(0.0f), m_HomeY(0.0f), m_HomeZ(0.0f), m_HomeOrientation(0.0f), m_reactState(REACT_PASSIVE), @@ -338,7 +338,7 @@ bool Creature::InitEntry(uint32 Entry, Team team, CreatureData const* data /*=NU else if (!data || data->equipmentId == 0) { // use default from the template - LoadEquipment(cinfo->equipmentId); + LoadEquipment(cinfo->equipment_id); } else if (data && data->equipmentId != -1) { @@ -346,7 +346,7 @@ bool Creature::InitEntry(uint32 Entry, Team team, CreatureData const* data /*=NU LoadEquipment(data->equipmentId); } - SetName(normalInfo->Name); // at normal entry always + SetName(normalInfo->name); // at normal entry always #if SUPPORTED_CLIENT_BUILD >= CLIENT_BUILD_1_12_1 SetFloatValue(UNIT_MOD_CAST_SPEED, 1.0f); #else @@ -361,7 +361,7 @@ bool Creature::InitEntry(uint32 Entry, Team team, CreatureData const* data /*=NU m_startwaypoint = data->currentwaypoint; // checked at loading - m_defaultMovementType = MovementGeneratorType(cinfo->MovementType); + m_defaultMovementType = MovementGeneratorType(cinfo->movement_type); return true; } @@ -446,7 +446,7 @@ bool Creature::UpdateEntry(uint32 Entry, Team team, const CreatureData *data /*= if (m_creatureInfo) // prevent aura unloading if this creature is still under creation { auto newAddonData = ObjectMgr::GetCreatureTemplateAddon(Entry); - auto prevAddonData = ObjectMgr::GetCreatureTemplateAddon(m_creatureInfo->Entry); + auto prevAddonData = ObjectMgr::GetCreatureTemplateAddon(m_creatureInfo->entry); auto creaAddonData = ObjectMgr::GetCreatureAddon(GetGUIDLow()); /* @@ -476,7 +476,8 @@ bool Creature::UpdateEntry(uint32 Entry, Team team, const CreatureData *data /*= LoadCreatureAddon(true); } - m_regenHealth = GetCreatureInfo()->RegenHealth; + m_bRegenHealth = GetCreatureInfo()->regeneration & REGEN_FLAG_HEALTH; + m_bRegenMana = GetCreatureInfo()->regeneration & REGEN_FLAG_POWER; // creatures always have melee weapon ready if any SetSheath(SHEATH_STATE_MELEE); @@ -486,12 +487,12 @@ bool Creature::UpdateEntry(uint32 Entry, Team team, const CreatureData *data /*= setFaction(GetCreatureInfo()->faction); - SetUInt32Value(UNIT_NPC_FLAGS, GetCreatureInfo()->npcflag); + SetUInt32Value(UNIT_NPC_FLAGS, GetCreatureInfo()->npc_flags); - uint32 attackTimer = GetCreatureInfo()->baseattacktime; + uint32 attackTimer = GetCreatureInfo()->base_attack_time; SetAttackTime(BASE_ATTACK, attackTimer); SetAttackTime(OFF_ATTACK, attackTimer); - SetAttackTime(RANGED_ATTACK, GetCreatureInfo()->rangeattacktime); + SetAttackTime(RANGED_ATTACK, GetCreatureInfo()->ranged_attack_time); uint32 unitFlags = GetCreatureInfo()->unit_flags; @@ -506,16 +507,16 @@ bool Creature::UpdateEntry(uint32 Entry, Team team, const CreatureData *data /*= // preserve all current dynamic flags if exist uint32 dynFlags = GetUInt32Value(UNIT_DYNAMIC_FLAGS); - SetUInt32Value(UNIT_DYNAMIC_FLAGS, dynFlags ? dynFlags : GetCreatureInfo()->dynamicflags); + SetUInt32Value(UNIT_DYNAMIC_FLAGS, dynFlags ? dynFlags : GetCreatureInfo()->dynamic_flags); SetModifierValue(UNIT_MOD_ARMOR, BASE_VALUE, float(GetCreatureInfo()->armor)); float resistances[] = { - float(GetCreatureInfo()->resistance1), - float(GetCreatureInfo()->resistance2), - float(GetCreatureInfo()->resistance3), - float(GetCreatureInfo()->resistance4), - float(GetCreatureInfo()->resistance5), - float(GetCreatureInfo()->resistance6) + float(GetCreatureInfo()->holy_res), + float(GetCreatureInfo()->fire_res), + float(GetCreatureInfo()->nature_res), + float(GetCreatureInfo()->frost_res), + float(GetCreatureInfo()->shadow_res), + float(GetCreatureInfo()->arcane_res) }; // set spell school immunity if resistance to that element = -1 in db @@ -534,7 +535,7 @@ bool Creature::UpdateEntry(uint32 Entry, Team team, const CreatureData *data /*= } SetFly(CanFly()); - SetMeleeDamageSchool(SpellSchools(GetCreatureInfo()->dmgschool)); + SetMeleeDamageSchool(SpellSchools(GetCreatureInfo()->dmg_school)); SetCanModifyStats(true); UpdateAllStats(); @@ -556,9 +557,9 @@ bool Creature::UpdateEntry(uint32 Entry, Team team, const CreatureData *data /*= for (int i = 0; i < CREATURE_MAX_SPELLS; ++i) m_spells[i] = GetCreatureInfo()->spells[i]; - SetCallForHelpDist(GetCreatureInfo()->CallForHelp); - SetLeashDistance(GetCreatureInfo()->Leash); - SetDetectionDistance(GetCreatureInfo()->Detection); + SetCallForHelpDist(GetCreatureInfo()->call_for_help_range); + SetLeashDistance(GetCreatureInfo()->leash_range); + SetDetectionDistance(GetCreatureInfo()->detection_range); // if eventData set then event active and need apply spell_start if (eventData) @@ -582,18 +583,18 @@ uint32 Creature::ChooseDisplayId(const CreatureInfo *cinfo, const CreatureData * // model selected here may be replaced with other_gender using own function uint32 maxDisplayId = 0; - for (; maxDisplayId < MAX_CREATURE_MODEL && cinfo->ModelId[maxDisplayId]; ++maxDisplayId); + for (; maxDisplayId < MAX_CREATURE_MODEL && cinfo->display_id[maxDisplayId]; ++maxDisplayId); if (maxDisplayId) - display_id = cinfo->ModelId[urand(0, maxDisplayId - 1)]; + display_id = cinfo->display_id[urand(0, maxDisplayId - 1)]; // fail safe, we use creature entry 1 and make error if (!display_id) { - sLog.outErrorDb("Call customer support, ChooseDisplayId can not select native model for creature entry %u, model from creature entry 1 will be used instead.", cinfo->Entry); + sLog.outErrorDb("Call customer support, ChooseDisplayId can not select native model for creature entry %u, model from creature entry 1 will be used instead.", cinfo->entry); if (const CreatureInfo *creatureDefault = ObjectMgr::GetCreatureTemplate(1)) - display_id = creatureDefault->ModelId[0]; + display_id = creatureDefault->display_id[0]; } return display_id; @@ -887,7 +888,7 @@ void Creature::RegenerateAll(uint32 update_diff, bool skipCombatCheck) void Creature::RegenerateMana() { - if (!_manaRegen) + if (!IsRegeneratingMana()) return; uint32 curValue = GetPower(POWER_MANA); @@ -1385,11 +1386,11 @@ void Creature::SaveToDB(uint32 mapid) CreatureInfo const *cinfo = GetCreatureInfo(); if (cinfo) { - if (displayId != cinfo->ModelId[0] && displayId != cinfo->ModelId[1] && displayId != cinfo->ModelId[2] && displayId != cinfo->ModelId[3]) + if (displayId != cinfo->display_id[0] && displayId != cinfo->display_id[1] && displayId != cinfo->display_id[2] && displayId != cinfo->display_id[3]) { for (int i = 0; i < MAX_CREATURE_MODEL && displayId; ++i) - if (cinfo->ModelId[i]) - if (CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelInfo(cinfo->ModelId[i])) + if (cinfo->display_id[i]) + if (CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelInfo(cinfo->display_id[i])) if (displayId == minfo->modelid_other_gender) displayId = 0; } @@ -1458,8 +1459,8 @@ void Creature::SelectLevel(const CreatureInfo *cinfo, float percentHealth, float uint32 rank = IsPet() ? 0 : cinfo->rank; // level - uint32 minlevel = std::min(cinfo->maxlevel, cinfo->minlevel); - uint32 maxlevel = std::max(cinfo->maxlevel, cinfo->minlevel); + uint32 minlevel = std::min(cinfo->level_max, cinfo->level_min); + uint32 maxlevel = std::max(cinfo->level_max, cinfo->level_min); uint32 level = minlevel == maxlevel ? minlevel : urand(minlevel, maxlevel); SetLevel(level); @@ -1468,8 +1469,8 @@ void Creature::SelectLevel(const CreatureInfo *cinfo, float percentHealth, float // health float healthmod = _GetHealthMod(rank); - uint32 minhealth = std::min(cinfo->maxhealth, cinfo->minhealth); - uint32 maxhealth = std::max(cinfo->maxhealth, cinfo->minhealth); + uint32 minhealth = std::min(cinfo->health_max, cinfo->health_min); + uint32 maxhealth = std::max(cinfo->health_max, cinfo->health_min); uint32 health = uint32(healthmod * (minhealth + uint32(rellevel * (maxhealth - minhealth)))); SetCreateHealth(health); @@ -1481,8 +1482,8 @@ void Creature::SelectLevel(const CreatureInfo *cinfo, float percentHealth, float SetHealthPercent(percentHealth); // mana - uint32 minmana = std::min(cinfo->maxmana, cinfo->minmana); - uint32 maxmana = std::max(cinfo->maxmana, cinfo->minmana); + uint32 minmana = std::min(cinfo->mana_max, cinfo->mana_min); + uint32 maxmana = std::max(cinfo->mana_max, cinfo->mana_min); uint32 mana = minmana + uint32(rellevel * (maxmana - minmana)); SetCreateMana(mana); @@ -1497,16 +1498,16 @@ void Creature::SelectLevel(const CreatureInfo *cinfo, float percentHealth, float // damage float damagemod = _GetDamageMod(rank); - SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, cinfo->mindmg * damagemod); - SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, cinfo->maxdmg * damagemod); + SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, cinfo->dmg_min * damagemod); + SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, cinfo->dmg_max * damagemod); - SetBaseWeaponDamage(OFF_ATTACK, MINDAMAGE, cinfo->mindmg * damagemod); - SetBaseWeaponDamage(OFF_ATTACK, MAXDAMAGE, cinfo->maxdmg * damagemod); + SetBaseWeaponDamage(OFF_ATTACK, MINDAMAGE, cinfo->dmg_min * damagemod); + SetBaseWeaponDamage(OFF_ATTACK, MAXDAMAGE, cinfo->dmg_max * damagemod); - SetFloatValue(UNIT_FIELD_MINRANGEDDAMAGE, cinfo->minrangedmg * damagemod); - SetFloatValue(UNIT_FIELD_MAXRANGEDDAMAGE, cinfo->maxrangedmg * damagemod); + SetFloatValue(UNIT_FIELD_MINRANGEDDAMAGE, cinfo->ranged_dmg_min * damagemod); + SetFloatValue(UNIT_FIELD_MAXRANGEDDAMAGE, cinfo->ranged_dmg_max * damagemod); - SetModifierValue(UNIT_MOD_ATTACK_POWER, BASE_VALUE, cinfo->attackpower * damagemod); + SetModifierValue(UNIT_MOD_ATTACK_POWER, BASE_VALUE, cinfo->attack_power * damagemod); } float Creature::_GetHealthMod(int32 Rank) @@ -1569,11 +1570,11 @@ float Creature::GetSpellDamageMod(int32 Rank) bool Creature::CreateFromProto(uint32 guidlow, CreatureInfo const* cinfo, Team team, const CreatureData *data /*=NULL*/, GameEventCreatureData const* eventData /*=NULL*/) { SetZoneScript(); - m_originalEntry = cinfo->Entry; + m_originalEntry = cinfo->entry; - Object::_Create(guidlow, cinfo->Entry, cinfo->GetHighGuid()); + Object::_Create(guidlow, cinfo->entry, cinfo->GetHighGuid()); - if (!UpdateEntry(cinfo->Entry, team, data, eventData, false)) + if (!UpdateEntry(cinfo->entry, team, data, eventData, false)) return false; return true; @@ -1838,8 +1839,8 @@ void Creature::SetDeathState(DeathState s) SetTargetGuid(ObjectGuid()); // remove target selection in any cases (can be set at aura remove in Unit::SetDeathState) SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE); - if (!IsPet() && GetCreatureInfo()->SkinLootId) - if (LootTemplates_Skinning.HaveLootFor(GetCreatureInfo()->SkinLootId)) + if (!IsPet() && GetCreatureInfo()->skinning_loot_id) + if (LootTemplates_Skinning.HaveLootFor(GetCreatureInfo()->skinning_loot_id)) if (HasLootRecipient()) SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE); @@ -1870,7 +1871,7 @@ void Creature::SetDeathState(DeathState s) Unit::SetDeathState(ALIVE); - SetMeleeDamageSchool(SpellSchools(cinfo->dmgschool)); + SetMeleeDamageSchool(SpellSchools(cinfo->dmg_school)); // Dynamic flags may be adjusted by spells. Clear them // first and let spell from *addon apply where needed. @@ -1879,7 +1880,7 @@ void Creature::SetDeathState(DeathState s) // Flags after LoadCreatureAddon. Any spell in *addon // will not be able to adjust these. - SetUInt32Value(UNIT_NPC_FLAGS, cinfo->npcflag); + SetUInt32Value(UNIT_NPC_FLAGS, cinfo->npc_flags); RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE); SetWalk(true, true); @@ -1969,10 +1970,10 @@ bool Creature::IsImmuneToSpell(SpellEntry const *spellInfo, bool castOnSelf) if (!castOnSelf) { - if (spellInfo->Mechanic && GetCreatureInfo()->MechanicImmuneMask & (1 << (spellInfo->Mechanic - 1))) + if (spellInfo->Mechanic && GetCreatureInfo()->mechanic_immune_mask & (1 << (spellInfo->Mechanic - 1))) return true; - if (GetCreatureInfo()->SchoolImmuneMask & (1 << spellInfo->School)) + if (GetCreatureInfo()->school_immune_mask & (1 << spellInfo->School)) return true; } @@ -1996,7 +1997,7 @@ bool Creature::IsImmuneToSpell(SpellEntry const *spellInfo, bool castOnSelf) bool Creature::IsImmuneToDamage(SpellSchoolMask meleeSchoolMask, SpellEntry const* spellInfo) { - if (GetCreatureInfo()->SchoolImmuneMask & meleeSchoolMask) + if (GetCreatureInfo()->school_immune_mask & meleeSchoolMask) return true; return Unit::IsImmuneToDamage(meleeSchoolMask, spellInfo); @@ -2019,7 +2020,7 @@ void Creature::SetTauntImmunity(bool immune) bool Creature::IsImmuneToSpellEffect(SpellEntry const *spellInfo, SpellEffectIndex index, bool castOnSelf) const { - if (!castOnSelf && spellInfo->EffectMechanic[index] && GetCreatureInfo()->MechanicImmuneMask & (1 << (spellInfo->EffectMechanic[index] - 1))) + if (!castOnSelf && spellInfo->EffectMechanic[index] && GetCreatureInfo()->mechanic_immune_mask & (1 << (spellInfo->EffectMechanic[index] - 1))) return true; // Taunt immunity special flag check @@ -2444,7 +2445,7 @@ CreatureDataAddon const* Creature::GetCreatureAddon() const if (CreatureDataAddon const* addon = ObjectMgr::GetCreatureAddon(GetGUIDLow())) return addon; - return ObjectMgr::GetCreatureTemplateAddon(GetCreatureInfo()->Entry); + return ObjectMgr::GetCreatureTemplateAddon(GetCreatureInfo()->entry); } CreatureData const* Creature::GetCreatureData() const @@ -3010,7 +3011,7 @@ uint32 Creature::GetLevelForTarget(Unit const* target) const std::string Creature::GetAIName() const { - return ObjectMgr::GetCreatureTemplate(GetEntry())->AIName; + return ObjectMgr::GetCreatureTemplate(GetEntry())->ai_name; } std::string Creature::GetScriptName() const @@ -3020,7 +3021,7 @@ std::string Creature::GetScriptName() const uint32 Creature::GetScriptId() const { - return ObjectMgr::GetCreatureTemplate(GetEntry())->ScriptID; + return ObjectMgr::GetCreatureTemplate(GetEntry())->script_id; } VendorItemData const* Creature::GetVendorItems() const @@ -3030,7 +3031,7 @@ VendorItemData const* Creature::GetVendorItems() const VendorItemData const* Creature::GetVendorTemplateItems() const { - uint32 vendorId = GetCreatureInfo()->vendorId; + uint32 vendorId = GetCreatureInfo()->vendor_id; return vendorId ? sObjectMgr.GetNpcVendorTemplateItemList(vendorId) : NULL; } @@ -3115,7 +3116,7 @@ uint32 Creature::UpdateVendorItemCurrentCount(VendorItem const* vItem, uint32 us TrainerSpellData const* Creature::GetTrainerTemplateSpells() const { - uint32 trainerId = GetCreatureInfo()->trainerId; + uint32 trainerId = GetCreatureInfo()->trainer_id; return trainerId ? sObjectMgr.GetNpcTrainerTemplateSpells(trainerId) : NULL; } @@ -3272,8 +3273,8 @@ void Creature::ResetStats() { if (m_creatureInfo) { - SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, m_creatureInfo->mindmg); - SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, m_creatureInfo->maxdmg); + SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, m_creatureInfo->dmg_min); + SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, m_creatureInfo->dmg_max); UpdateDamagePhysical(BASE_ATTACK); } RemoveAllAuras(); diff --git a/src/game/Objects/Creature.h b/src/game/Objects/Creature.h index 4b21644dc..9fd34af18 100644 --- a/src/game/Objects/Creature.h +++ b/src/game/Objects/Creature.h @@ -75,7 +75,6 @@ enum CreatureFlagsExtra #pragma pack(push,1) #endif -#define MAX_KILL_CREDIT 2 #define MAX_CREATURE_MODEL 4 // only single send to client in static data #define CREATURE_FLEE_TEXT 1150 @@ -87,76 +86,75 @@ enum CreatureFlagsExtra // from `creature_template` table struct CreatureInfo { - uint32 Entry; - uint32 KillCredit[MAX_KILL_CREDIT]; - uint32 ModelId[MAX_CREATURE_MODEL]; - char* Name; - char* SubName; - uint32 GossipMenuId; - uint32 minlevel; - uint32 maxlevel; - uint32 minhealth; - uint32 maxhealth; - uint32 minmana; - uint32 maxmana; + uint32 entry; + uint32 display_id[MAX_CREATURE_MODEL]; + char* name; + char* subname; + uint32 gossip_menu_id; + uint32 level_min; + uint32 level_max; + uint32 health_min; + uint32 health_max; + uint32 mana_min; + uint32 mana_max; uint32 armor; uint32 faction; - uint32 npcflag; + uint32 npc_flags; float speed_walk; float speed_run; float scale; - float Detection; // Detection Range for Line of Sight aggro - float CallForHelp; // Radius for combat assistance call - float Leash; // Hard limit on allowed chase distance + float detection_range; // Detection Range for Line of Sight aggro + float call_for_help_range; // Radius for combat assistance call + float leash_range; // Hard limit on allowed chase distance uint32 rank; - float ExperienceMultiplier; - float mindmg; - float maxdmg; - uint32 dmgschool; - uint32 attackpower; + float xp_multiplier; + float dmg_min; + float dmg_max; + uint32 dmg_school; + uint32 attack_power; float dmg_multiplier; - uint32 baseattacktime; - uint32 rangeattacktime; + uint32 base_attack_time; + uint32 ranged_attack_time; uint32 unit_class; // enum Classes. Note only 4 classes are known for creatures. uint32 unit_flags; // enum UnitFlags mask values - uint32 dynamicflags; - uint32 family; // enum CreatureFamily values (optional) + uint32 dynamic_flags; + uint32 beast_family; // enum CreatureFamily values (optional) uint32 trainer_type; uint32 trainer_spell; uint32 trainer_class; uint32 trainer_race; - float minrangedmg; - float maxrangedmg; - uint32 rangedattackpower; + float ranged_dmg_min; + float ranged_dmg_max; + uint32 ranged_attack_power; uint32 type; // enum CreatureType values uint32 type_flags; // enum CreatureTypeFlags mask values - uint32 lootid; - uint32 pickpocketLootId; - uint32 SkinLootId; - int32 resistance1; - int32 resistance2; - int32 resistance3; - int32 resistance4; - int32 resistance5; - int32 resistance6; + uint32 loot_id; + uint32 pickpocket_loot_id; + uint32 skinning_loot_id; + int32 holy_res; + int32 fire_res; + int32 nature_res; + int32 frost_res; + int32 shadow_res; + int32 arcane_res; uint32 spells[CREATURE_MAX_SPELLS]; - uint32 spells_template; - uint32 PetSpellDataId; - uint32 mingold; - uint32 maxgold; - char const* AIName; - uint32 MovementType; - uint32 InhabitType; + uint32 spell_list_id; + uint32 pet_spell_list_id; + uint32 gold_min; + uint32 gold_max; + char const* ai_name; + uint32 movement_type; + uint32 inhabit_type; uint32 civilian; - bool RacialLeader; - bool RegenHealth; - uint32 equipmentId; - uint32 trainerId; - uint32 vendorId; - uint32 MechanicImmuneMask; - uint32 SchoolImmuneMask; + bool racial_leader; + uint32 regeneration; + uint32 equipment_id; + uint32 trainer_id; + uint32 vendor_id; + uint32 mechanic_immune_mask; + uint32 school_immune_mask; uint32 flags_extra; - uint32 ScriptID; + uint32 script_id; // helpers static HighGuid GetHighGuid() @@ -164,7 +162,7 @@ struct CreatureInfo return HIGHGUID_UNIT; // in pre-3.x always HIGHGUID_UNIT } - ObjectGuid GetObjectGuid(uint32 lowguid) const { return ObjectGuid(GetHighGuid(), Entry, lowguid); } + ObjectGuid GetObjectGuid(uint32 lowguid) const { return ObjectGuid(GetHighGuid(), entry, lowguid); } SkillType GetRequiredLootSkill() const { @@ -178,7 +176,7 @@ struct CreatureInfo bool isTameable() const { - return type == CREATURE_TYPE_BEAST && family != 0 && type_flags & CREATURE_TYPEFLAGS_TAMEABLE; + return type == CREATURE_TYPE_BEAST && beast_family != 0 && type_flags & CREATURE_TYPEFLAGS_TAMEABLE; } }; @@ -308,6 +306,12 @@ enum SelectFlags SELECT_FLAG_NOT_PLAYER = 0x800, }; +enum RegenStatsFlags +{ + REGEN_FLAG_HEALTH = 0x001, + REGEN_FLAG_POWER = 0x002, +}; + // Vendors struct VendorItem { @@ -502,7 +506,7 @@ class MANGOS_DLL_SPEC Creature : public Unit uint32 GetDBTableGUIDLow() const; uint32 GetDBTableEntry() const; - char const* GetSubName() const { return GetCreatureInfo()->SubName; } + char const* GetSubName() const { return GetCreatureInfo()->subname; } void Update(uint32 update_diff, uint32 time) override; // overwrite Unit::Update @@ -526,7 +530,7 @@ class MANGOS_DLL_SPEC Creature : public Unit bool IsCorpse() const { return getDeathState() == CORPSE; } bool IsDespawned() const { return getDeathState() == DEAD; } void SetCorpseDelay(uint32 delay) { m_corpseDelay = delay; } - bool IsRacialLeader() const { return GetCreatureInfo()->RacialLeader; } + bool IsRacialLeader() const { return GetCreatureInfo()->racial_leader; } bool IsCivilian() const { return GetCreatureInfo()->civilian; } bool IsTrigger() const { return GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_INVISIBLE; } bool IsGuard() const { return GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_GUARD; } @@ -540,9 +544,9 @@ class MANGOS_DLL_SPEC Creature : public Unit bool IsImmuneToAoe() const { return GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_IMMUNE_AOE; } #endif - bool CanWalk() const override { return GetCreatureInfo()->InhabitType & INHABIT_GROUND; } - bool CanSwim() const override { return IsPet() || GetCreatureInfo()->InhabitType & INHABIT_WATER; } - bool CanFly() const override { return !IsPet() && GetCreatureInfo()->InhabitType & INHABIT_AIR; } + bool CanWalk() const override { return GetCreatureInfo()->inhabit_type & INHABIT_GROUND; } + bool CanSwim() const override { return IsPet() || GetCreatureInfo()->inhabit_type & INHABIT_WATER; } + bool CanFly() const override { return !IsPet() && GetCreatureInfo()->inhabit_type & INHABIT_AIR; } void SetReactState(ReactStates st) { m_reactState = st; } ReactStates GetReactState() const { return m_reactState; } @@ -812,10 +816,11 @@ class MANGOS_DLL_SPEC Creature : public Unit bool HasQuest(uint32 quest_id) const override; bool HasInvolvedQuest(uint32 quest_id) const override; - uint32 GetDefaultGossipMenuId() const override { return GetCreatureInfo()->GossipMenuId; } + uint32 GetDefaultGossipMenuId() const override { return GetCreatureInfo()->gossip_menu_id; } GridReference &GetGridRef() { return m_gridRef; } - bool IsRegeneratingHealth() const { return m_regenHealth; } + bool IsRegeneratingHealth() const { return m_bRegenHealth; } + bool IsRegeneratingMana() const { return m_bRegenMana; } virtual uint8 GetPetAutoSpellSize() const { return CREATURE_MAX_SPELLS; } virtual uint32 GetPetAutoSpellOnPos(uint8 pos) const { @@ -855,8 +860,7 @@ class MANGOS_DLL_SPEC Creature : public Unit void SetTempPacified(uint32 timer) { if (_pacifiedTimer < timer) _pacifiedTimer = timer; } uint32 GetTempPacifiedTimer() const { return _pacifiedTimer; } uint32 _pacifiedTimer; - void AllowManaRegen(bool v) { _manaRegen = v; } - bool _manaRegen; + void AllowManaRegen(bool v) { m_bRegenMana = v; } uint32 m_manaRegen; uint32 m_startwaypoint; // currentwaypoint from creature table @@ -957,7 +961,8 @@ class MANGOS_DLL_SPEC Creature : public Unit // below fields has potential for optimization bool m_AlreadyCallAssistance; bool m_AlreadySearchedAssistance; - bool m_regenHealth; + bool m_bRegenHealth; + bool m_bRegenMana; bool m_AI_locked; bool m_AI_InitializeOnRespawn; bool m_isDeadByDefault; diff --git a/src/game/Objects/Pet.cpp b/src/game/Objects/Pet.cpp index df7994047..44f3a270c 100644 --- a/src/game/Objects/Pet.cpp +++ b/src/game/Objects/Pet.cpp @@ -1233,7 +1233,7 @@ bool Pet::CreateBaseAtCreature(Creature* creature) SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, sObjectMgr.GetXPForPetLevel(creature->getLevel())); SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE); - if (CreatureFamilyEntry const* cFamily = sCreatureFamilyStore.LookupEntry(cinfo->family)) + if (CreatureFamilyEntry const* cFamily = sCreatureFamilyStore.LookupEntry(cinfo->beast_family)) SetName(cFamily->Name[sWorld.GetDefaultDbcLocale()]); else SetName(creature->GetNameForLocaleIdx(sObjectMgr.GetDBCLocaleIndex())); @@ -1269,12 +1269,12 @@ bool Pet::InitStatsForLevel(uint32 petlevel, Unit* owner) owner = GetOwner(); if (!owner) { - sLog.outError("attempt to summon pet (Entry %u) without owner! Attempt terminated.", cinfo->Entry); + sLog.outError("attempt to summon pet (Entry %u) without owner! Attempt terminated.", cinfo->entry); return false; } } - uint32 creature_ID = (getPetType() == HUNTER_PET) ? 1 : cinfo->Entry; + uint32 creature_ID = (getPetType() == HUNTER_PET) ? 1 : cinfo->entry; switch (getPetType()) { @@ -1300,22 +1300,22 @@ bool Pet::InitStatsForLevel(uint32 petlevel, Unit* owner) // Before 1.9 pets retain their wild damage type if (sWorld.GetWowPatch() < WOW_PATCH_109 && sWorld.getConfig(CONFIG_BOOL_ACCURATE_PETS)) - SetMeleeDamageSchool(SpellSchools(cinfo->dmgschool)); + SetMeleeDamageSchool(SpellSchools(cinfo->dmg_school)); else SetMeleeDamageSchool(SPELL_SCHOOL_NORMAL); SetModifierValue(UNIT_MOD_ARMOR, BASE_VALUE, float(petlevel * 50)); // Nostalrius: pre-2.0: normalisation de la vitesse d'attaque des pets. - SetAttackTime(BASE_ATTACK, cinfo->baseattacktime); //BASE_ATTACK_TIME); - SetAttackTime(OFF_ATTACK, cinfo->baseattacktime); //BASE_ATTACK_TIME); - SetAttackTime(RANGED_ATTACK, cinfo->rangeattacktime); //BASE_ATTACK_TIME); + SetAttackTime(BASE_ATTACK, cinfo->base_attack_time); //BASE_ATTACK_TIME); + SetAttackTime(OFF_ATTACK, cinfo->base_attack_time); //BASE_ATTACK_TIME); + SetAttackTime(RANGED_ATTACK, cinfo->ranged_attack_time); //BASE_ATTACK_TIME); #if SUPPORTED_CLIENT_BUILD >= CLIENT_BUILD_1_12_1 SetFloatValue(UNIT_MOD_CAST_SPEED, 1.0f); #else SetInt32Value(UNIT_MOD_CAST_SPEED, 0); #endif - CreatureFamilyEntry const* cFamily = sCreatureFamilyStore.LookupEntry(cinfo->family); + CreatureFamilyEntry const* cFamily = sCreatureFamilyStore.LookupEntry(cinfo->beast_family); if (cFamily && cFamily->minScale > 0.0f && getPetType() == HUNTER_PET) { float scale; @@ -1338,12 +1338,12 @@ bool Pet::InitStatsForLevel(uint32 petlevel, Unit* owner) // TODO: Do we keep it or remove it? if (getPetType() != HUNTER_PET || (sWorld.GetWowPatch() < WOW_PATCH_103 && sWorld.getConfig(CONFIG_BOOL_ACCURATE_PETS))) { - createResistance[SPELL_SCHOOL_HOLY] = cinfo->resistance1; - createResistance[SPELL_SCHOOL_FIRE] = cinfo->resistance2; - createResistance[SPELL_SCHOOL_NATURE] = cinfo->resistance3; - createResistance[SPELL_SCHOOL_FROST] = cinfo->resistance4; - createResistance[SPELL_SCHOOL_SHADOW] = cinfo->resistance5; - createResistance[SPELL_SCHOOL_ARCANE] = cinfo->resistance6; + createResistance[SPELL_SCHOOL_HOLY] = cinfo->holy_res; + createResistance[SPELL_SCHOOL_FIRE] = cinfo->fire_res; + createResistance[SPELL_SCHOOL_NATURE] = cinfo->nature_res; + createResistance[SPELL_SCHOOL_FROST] = cinfo->frost_res; + createResistance[SPELL_SCHOOL_SHADOW] = cinfo->shadow_res; + createResistance[SPELL_SCHOOL_ARCANE] = cinfo->arcane_res; } switch (getPetType()) @@ -1354,7 +1354,7 @@ bool Pet::InitStatsForLevel(uint32 petlevel, Unit* owner) SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float((petlevel * 1.15 * 1.05) * (float)GetAttackTime(BASE_ATTACK) / 2000)); SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, float((petlevel * 1.45 * 1.05) * (float)GetAttackTime(BASE_ATTACK) / 2000)); - //SetModifierValue(UNIT_MOD_ATTACK_POWER, BASE_VALUE, float(cinfo->attackpower)); + //SetModifierValue(UNIT_MOD_ATTACK_POWER, BASE_VALUE, float(cinfo->attack_power)); PetLevelInfo const* pInfo = sObjectMgr.GetPetLevelInfo(creature_ID, petlevel); if (pInfo) // exist in DB @@ -1372,11 +1372,11 @@ bool Pet::InitStatsForLevel(uint32 petlevel, Unit* owner) { // Erreur qui se declanche quand un mob invoque un add (squelette par exemple), et qui n'a // donc pas de stats de pet. - DEBUG_LOG("Summoned pet (Entry: %u) not have pet stats data in DB", cinfo->Entry); + DEBUG_LOG("Summoned pet (Entry: %u) not have pet stats data in DB", cinfo->entry); // remove elite bonuses included in DB values - SetCreateHealth(uint32(((float(cinfo->maxhealth) / cinfo->maxlevel) / (1 + 2 * cinfo->rank)) * petlevel)); - SetCreateMana(uint32(((float(cinfo->maxmana) / cinfo->maxlevel) / (1 + 2 * cinfo->rank)) * petlevel)); + SetCreateHealth(uint32(((float(cinfo->health_max) / cinfo->level_max) / (1 + 2 * cinfo->rank)) * petlevel)); + SetCreateMana(uint32(((float(cinfo->mana_max) / cinfo->level_max) / (1 + 2 * cinfo->rank)) * petlevel)); SetCreateStat(STAT_STRENGTH, 22); SetCreateStat(STAT_AGILITY, 22); @@ -1399,7 +1399,7 @@ bool Pet::InitStatsForLevel(uint32 petlevel, Unit* owner) { SetCreateHealth(pInfo->health); SetModifierValue(UNIT_MOD_ARMOR, BASE_VALUE, float(pInfo->armor)); - //SetModifierValue(UNIT_MOD_ATTACK_POWER, BASE_VALUE, float(cinfo->attackpower)); + //SetModifierValue(UNIT_MOD_ATTACK_POWER, BASE_VALUE, float(cinfo->attack_power)); for (int i = STAT_STRENGTH; i < MAX_STATS; ++i) SetCreateStat(Stats(i), float(pInfo->stats[i])); @@ -1409,7 +1409,7 @@ bool Pet::InitStatsForLevel(uint32 petlevel, Unit* owner) sLog.outErrorDb("Hunter pet levelstats missing in DB"); // remove elite bonuses included in DB values - SetCreateHealth(uint32(((float(cinfo->maxhealth) / cinfo->maxlevel) / (1 + 2 * cinfo->rank)) * petlevel)); + SetCreateHealth(uint32(((float(cinfo->health_max) / cinfo->level_max) / (1 + 2 * cinfo->rank)) * petlevel)); SetCreateStat(STAT_STRENGTH, 22); SetCreateStat(STAT_AGILITY, 22); @@ -1426,15 +1426,15 @@ bool Pet::InitStatsForLevel(uint32 petlevel, Unit* owner) SetUInt32Value(UNIT_FIELD_FLAGS, cinfo->unit_flags); - SetCreateMana(cinfo->maxmana); - SetCreateHealth(cinfo->maxhealth); + SetCreateMana(cinfo->mana_max); + SetCreateHealth(cinfo->health_max); - SetAttackTime(BASE_ATTACK, cinfo->baseattacktime); - SetAttackTime(OFF_ATTACK, cinfo->baseattacktime); - SetAttackTime(RANGED_ATTACK, cinfo->rangeattacktime); + SetAttackTime(BASE_ATTACK, cinfo->base_attack_time); + SetAttackTime(OFF_ATTACK, cinfo->base_attack_time); + SetAttackTime(RANGED_ATTACK, cinfo->ranged_attack_time); - SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, cinfo->mindmg); - SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, cinfo->maxdmg); + SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, cinfo->dmg_min); + SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, cinfo->dmg_max); break; } default: @@ -1480,7 +1480,7 @@ bool Pet::HaveInDiet(ItemPrototype const* item) const if (!cInfo) return false; - CreatureFamilyEntry const* cFamily = sCreatureFamilyStore.LookupEntry(cInfo->family); + CreatureFamilyEntry const* cFamily = sCreatureFamilyStore.LookupEntry(cInfo->beast_family); if (!cFamily) return false; @@ -2230,9 +2230,9 @@ bool Pet::Create(uint32 guidlow, CreatureCreatePos& cPos, CreatureInfo const* ci Object::_Create(guidlow, pet_number, HIGHGUID_PET); - m_originalEntry = cinfo->Entry; + m_originalEntry = cinfo->entry; - if (!InitEntry(cinfo->Entry)) + if (!InitEntry(cinfo->entry)) return false; cPos.SelectFinalPoint(this); @@ -2262,7 +2262,7 @@ void Pet::LearnPetPassives() if (!cInfo) return; - CreatureFamilyEntry const* cFamily = sCreatureFamilyStore.LookupEntry(cInfo->family); + CreatureFamilyEntry const* cFamily = sCreatureFamilyStore.LookupEntry(cInfo->beast_family); if (!cFamily) return; diff --git a/src/game/Objects/Player.cpp b/src/game/Objects/Player.cpp index 0b3c195d3..7ec2ff1ef 100644 --- a/src/game/Objects/Player.cpp +++ b/src/game/Objects/Player.cpp @@ -1663,7 +1663,7 @@ bool Player::BuildEnumData(QueryResult * result, WorldPacket * p_data) { petDisplayId = fields[17].GetUInt32(); petLevel = fields[18].GetUInt32(); - petFamily = cInfo->family; + petFamily = cInfo->beast_family; } } @@ -7671,7 +7671,7 @@ void Player::SendLoot(ObjectGuid guid, LootType loot_type, Player* pVictim) if (loot_type == LOOT_PICKPOCKETING) { - uint32 lootid = creature->GetCreatureInfo()->pickpocketLootId; + uint32 lootid = creature->GetCreatureInfo()->pickpocket_loot_id; if (!creature->lootForPickPocketed) { @@ -7755,7 +7755,7 @@ void Player::SendLoot(ObjectGuid guid, LootType loot_type, Player* pVictim) { creature->lootForSkin = true; loot->clear(); - loot->FillLoot(creature->GetCreatureInfo()->SkinLootId, LootTemplates_Skinning, this, false); + loot->FillLoot(creature->GetCreatureInfo()->skinning_loot_id, LootTemplates_Skinning, this, false); // let reopen skinning loot if will closed. if (!loot->empty()) @@ -13712,12 +13712,8 @@ void Player::ItemRemovedQuestCheck(uint32 entry, uint32 count) void Player::KilledMonster(CreatureInfo const* cInfo, ObjectGuid guid) { - if (cInfo->Entry) - KilledMonsterCredit(cInfo->Entry, guid); - - for (int i = 0; i < MAX_KILL_CREDIT; ++i) - if (cInfo->KillCredit[i]) - KilledMonsterCredit(cInfo->KillCredit[i], guid); + if (cInfo->entry) + KilledMonsterCredit(cInfo->entry, guid); } void Player::KilledMonsterCredit(uint32 entry, ObjectGuid guid) diff --git a/src/game/Objects/Unit.cpp b/src/game/Objects/Unit.cpp index 97d47c7f2..f6b0a1c2d 100644 --- a/src/game/Objects/Unit.cpp +++ b/src/game/Objects/Unit.cpp @@ -826,7 +826,7 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa { creature->DeleteThreatList(); if (CreatureInfo const *cinfo = creature->GetCreatureInfo()) - if (cinfo->lootid || cinfo->maxgold > 0) + if (cinfo->loot_id || cinfo->gold_max > 0) creature->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); } // some critters required for quests @@ -1190,14 +1190,14 @@ void Unit::Kill(Unit* pVictim, SpellEntry const *spellProto, bool durabilityLoss loot->clear(); if (!(creature->AI() && creature->AI()->FillLoot(loot, looter))) { - if (uint32 lootid = creature->GetCreatureInfo()->lootid) + if (uint32 lootid = creature->GetCreatureInfo()->loot_id) { loot->SetTeam(group_tap ? group_tap->GetTeam() : looter->GetTeam()); loot->FillLoot(lootid, LootTemplates_Creature, looter, false, false, creature); } } - loot->generateMoneyLoot(creature->GetCreatureInfo()->mingold, creature->GetCreatureInfo()->maxgold); + loot->generateMoneyLoot(creature->GetCreatureInfo()->gold_min, creature->GetCreatureInfo()->gold_max); } if (group_tap) @@ -1323,7 +1323,7 @@ void Unit::Kill(Unit* pVictim, SpellEntry const *spellProto, bool durabilityLoss creature->DeleteThreatList(); if (CreatureInfo const *cinfo = creature->GetCreatureInfo()) - if (cinfo->lootid || cinfo->maxgold > 0) + if (cinfo->loot_id || cinfo->gold_max > 0) creature->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); } @@ -5525,7 +5525,7 @@ void Unit::SetInitCreaturePowerType() return; // a bit wrong, but have to follow the dirty database values - if (pCreature->GetCreatureInfo()->minmana > 0) + if (pCreature->GetCreatureInfo()->mana_min > 0) SetByteValue(UNIT_FIELD_BYTES_0, 3, POWER_MANA); else { diff --git a/src/game/ScriptMgr.cpp b/src/game/ScriptMgr.cpp index dd06a7286..dd6ef17bc 100644 --- a/src/game/ScriptMgr.cpp +++ b/src/game/ScriptMgr.cpp @@ -924,14 +924,14 @@ void ScriptMgr::LoadScripts(ScriptMapMap& scripts, const char* tablename) sLog.outErrorDb("Table `%s` has dataint%u with negative chance in SCRIPT_COMMAND_CREATURE_SPELLS for script id %u.", tablename, i, tmp.id); break; } - else if (tmp.creatureSpells.spellTemplate[i]) + else if (tmp.creatureSpells.spellListId[i]) { - if (!sObjectMgr.GetCreatureSpellsTemplate(tmp.creatureSpells.spellTemplate[i])) + if (!sObjectMgr.GetCreatureSpellsList(tmp.creatureSpells.spellListId[i])) { - if (!sObjectMgr.IsExistingCreatureSpellsId(tmp.creatureSpells.spellTemplate[i])) + if (!sObjectMgr.IsExistingCreatureSpellsId(tmp.creatureSpells.spellListId[i])) { abort = true; - sLog.outErrorDb("Table `%s` has datalong%u=%u for a non-existent creature spells template in SCRIPT_COMMAND_CREATURE_SPELLS for script id %u.", tablename, i, tmp.creatureSpells.spellTemplate[i], tmp.id); + sLog.outErrorDb("Table `%s` has datalong%u=%u for a non-existent creature spells template in SCRIPT_COMMAND_CREATURE_SPELLS for script id %u.", tablename, i, tmp.creatureSpells.spellListId[i], tmp.id); } else DisableScriptAction(tmp); @@ -940,7 +940,7 @@ void ScriptMgr::LoadScripts(ScriptMapMap& scripts, const char* tablename) if (!tmp.creatureSpells.chance[i]) { abort = true; - sLog.outErrorDb("Table `%s` has datalong%u=%u with 0%% chance in SCRIPT_COMMAND_CREATURE_SPELLS for script id %u.", tablename, i, tmp.creatureSpells.spellTemplate[i], tmp.id); + sLog.outErrorDb("Table `%s` has datalong%u=%u with 0%% chance in SCRIPT_COMMAND_CREATURE_SPELLS for script id %u.", tablename, i, tmp.creatureSpells.spellListId[i], tmp.id); break; } } @@ -1363,7 +1363,7 @@ void ScriptMgr::CheckScriptTexts(ScriptMapMap const& scripts) void ScriptMgr::LoadAreaTriggerScripts() { m_AreaTriggerScripts.clear(); // need for reload case - QueryResult *result = WorldDatabase.Query("SELECT entry, ScriptName FROM scripted_areatrigger"); + QueryResult *result = WorldDatabase.Query("SELECT entry, script_name FROM scripted_areatrigger"); uint32 count = 0; @@ -1409,7 +1409,7 @@ void ScriptMgr::LoadAreaTriggerScripts() void ScriptMgr::LoadEventIdScripts() { m_EventIdScripts.clear(); // need for reload case - QueryResult *result = WorldDatabase.Query("SELECT id, ScriptName FROM scripted_event_id"); + QueryResult *result = WorldDatabase.Query("SELECT id, script_name FROM scripted_event_id"); uint32 count = 0; @@ -1458,15 +1458,15 @@ void ScriptMgr::LoadScriptNames() { m_scriptNames.push_back(""); QueryResult *result = WorldDatabase.Query( - "SELECT DISTINCT(ScriptName) FROM creature_template WHERE ScriptName <> '' " + "SELECT DISTINCT(script_name) FROM creature_template WHERE script_name <> '' " "UNION " - "SELECT DISTINCT(ScriptName) FROM gameobject_template WHERE ScriptName <> '' " + "SELECT DISTINCT(script_name) FROM gameobject_template WHERE script_name <> '' " "UNION " - "SELECT DISTINCT(ScriptName) FROM scripted_areatrigger WHERE ScriptName <> '' " + "SELECT DISTINCT(script_name) FROM scripted_areatrigger WHERE script_name <> '' " "UNION " - "SELECT DISTINCT(ScriptName) FROM scripted_event_id WHERE ScriptName <> '' " + "SELECT DISTINCT(script_name) FROM scripted_event_id WHERE script_name <> '' " "UNION " - "SELECT DISTINCT(ScriptName) FROM map_template WHERE ScriptName <> ''"); + "SELECT DISTINCT(script_name) FROM map_template WHERE script_name <> ''"); if (!result) { @@ -1823,7 +1823,7 @@ void ScriptMgr::Initialize() for (uint32 i = 1; i < GetScriptIdsCount(); ++i) { if (!m_scripts[i]) - sLog.outError("No script found for ScriptName '%s'.", GetScriptName(i)); + sLog.outError("No script found for script_name '%s'.", GetScriptName(i)); } sLog.outString(">> Loaded %i C++ Scripts.", num_sc_scripts); @@ -2007,8 +2007,8 @@ void ScriptMgr::LoadScriptWaypoints() continue; } - if (!pCInfo->ScriptID) - sLog.outErrorDb("DB table script_waypoint has waypoint for creature entry %u, but creature does not have ScriptName defined and then useless.", pTemp.uiCreatureEntry); + if (!pCInfo->script_id) + sLog.outErrorDb("DB table script_waypoint has waypoint for creature entry %u, but creature does not have script_name defined and then useless.", pTemp.uiCreatureEntry); m_mPointMoveMap[uiEntry].push_back(pTemp); ++uiNodeCount; @@ -2058,8 +2058,8 @@ void ScriptMgr::LoadEscortData() continue; } - if (!pCInfo->ScriptID) - sLog.outErrorDb("DB table script_escort_data has data for creature entry %u, but creature does not have ScriptName defined and then useless.", pTemp.uiCreatureEntry); + if (!pCInfo->script_id) + sLog.outErrorDb("DB table script_escort_data has data for creature entry %u, but creature does not have script_name defined and then useless.", pTemp.uiCreatureEntry); // Calcul de uiLastWaypointEntry, et mise en "cache" std::vector const points = GetPointMoveList(pTemp.uiCreatureEntry); @@ -2483,7 +2483,7 @@ void Script::RegisterSelf(bool bReportError) { // Don't report unused generic scripts if (bReportError) - sLog.outError("Script registering but ScriptName %s is not assigned in database. Script will not be used.", Name.c_str()); + sLog.outError("Script registering but script_name %s is not assigned in database. Script will not be used.", Name.c_str()); delete this; } diff --git a/src/game/ScriptMgr.h b/src/game/ScriptMgr.h index 603b2fd28..e6b5f1030 100644 --- a/src/game/ScriptMgr.h +++ b/src/game/ScriptMgr.h @@ -818,7 +818,7 @@ struct ScriptInfo struct // SCRIPT_COMMAND_CREATURE_SPELLS (55) { - uint32 spellTemplate[4]; // datalong to datalong4 + uint32 spellListId[4]; // datalong to datalong4 uint32 unused; // data_flags int32 chance[4]; // dataint to dataint4 } creatureSpells; diff --git a/src/game/Spells/SpellAuras.cpp b/src/game/Spells/SpellAuras.cpp index cccc8ac97..e070a01eb 100644 --- a/src/game/Spells/SpellAuras.cpp +++ b/src/game/Spells/SpellAuras.cpp @@ -2512,7 +2512,7 @@ void Aura::HandleAuraTransform(bool apply, bool Real) // creature case, need to update equipment if (ci && target->GetTypeId() == TYPEID_UNIT) - ((Creature*)target)->LoadEquipment(ci->equipmentId, true); + ((Creature*)target)->LoadEquipment(ci->equipment_id, true); } if (model_id) @@ -2534,7 +2534,7 @@ void Aura::HandleAuraTransform(bool apply, bool Real) // apply default equipment for creature case if (target->GetTypeId() == TYPEID_UNIT) - ((Creature*)target)->LoadEquipment(((Creature*)target)->GetCreatureInfo()->equipmentId, true); + ((Creature*)target)->LoadEquipment(((Creature*)target)->GetCreatureInfo()->equipment_id, true); // re-apply some from still active with preference negative cases @@ -3053,9 +3053,9 @@ void Aura::HandleModCharm(bool apply, bool Real) if (target->GetByteValue(UNIT_FIELD_BYTES_0, 1) == 0) { if (cinfo->unit_class == 0) - sLog.outErrorDb("Creature (Entry: %u) have unit_class = 0 but used in charmed spell, that will be result client crash.", cinfo->Entry); + sLog.outErrorDb("Creature (Entry: %u) have unit_class = 0 but used in charmed spell, that will be result client crash.", cinfo->entry); else - sLog.outError("Creature (Entry: %u) have unit_class = %u but at charming have class 0!!! that will be result client crash.", cinfo->Entry, cinfo->unit_class); + sLog.outError("Creature (Entry: %u) have unit_class = %u but at charming have class 0!!! that will be result client crash.", cinfo->entry, cinfo->unit_class); target->SetByteValue(UNIT_FIELD_BYTES_0, 1, CLASS_MAGE); } diff --git a/src/game/Spells/SpellEffects.cpp b/src/game/Spells/SpellEffects.cpp index 882f77f7d..cef43df6f 100644 --- a/src/game/Spells/SpellEffects.cpp +++ b/src/game/Spells/SpellEffects.cpp @@ -2972,7 +2972,7 @@ void Spell::EffectSummon(SpellEffectIndex eff_idx) uint32 pet_number = sObjectMgr.GeneratePetNumber(); if (!spawnCreature->Create(map->GenerateLocalLowGuid(HIGHGUID_PET), pos, cInfo, pet_number)) { - sLog.outErrorDb("Spell::EffectSummon: can't create creature with entry %u for spell %u", cInfo->Entry, m_spellInfo->Id); + sLog.outErrorDb("Spell::EffectSummon: can't create creature with entry %u for spell %u", cInfo->entry, m_spellInfo->Id); delete spawnCreature; return; } @@ -3460,7 +3460,7 @@ void Spell::EffectSummonGuardian(SpellEffectIndex eff_idx) // Summoned by unit: use creature level but cap at owner level if (m_caster->GetTypeId() == TYPEID_UNIT) { - uint32 creaturelevel = cInfo->minlevel == cInfo->maxlevel ? cInfo->minlevel : urand(cInfo->minlevel, cInfo->maxlevel); + uint32 creaturelevel = cInfo->level_min == cInfo->level_max ? cInfo->level_min : urand(cInfo->level_min, cInfo->level_max); if (creaturelevel < level) level = creaturelevel; } // Summoned by player @@ -3472,9 +3472,9 @@ void Spell::EffectSummonGuardian(SpellEffectIndex eff_idx) level = m_spellInfo->spellLevel; } // Else match with owner level but cap at creature max - else if (cInfo->maxlevel < level) + else if (cInfo->level_max < level) { - level = cInfo->maxlevel; + level = cInfo->level_max; } // Engineering summons always scale with skill points if (m_CastItem) @@ -3542,7 +3542,7 @@ void Spell::EffectSummonGuardian(SpellEffectIndex eff_idx) //spawnCreature->SetName(""); // generated by client spawnCreature->SetOwnerGuid(m_caster->GetObjectGuid()); spawnCreature->SetInitCreaturePowerType(); - spawnCreature->SetUInt32Value(UNIT_NPC_FLAGS, spawnCreature->GetCreatureInfo()->npcflag); + spawnCreature->SetUInt32Value(UNIT_NPC_FLAGS, spawnCreature->GetCreatureInfo()->npc_flags); spawnCreature->setFaction(m_caster->getFaction()); spawnCreature->SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, 0); spawnCreature->SetCreatorGuid(m_caster->GetObjectGuid()); @@ -5999,7 +5999,7 @@ void Spell::EffectSummonCritter(SpellEffectIndex eff_idx) critter->AIM_Initialize(); critter->InitPetCreateSpells(); // e.g. disgusting oozeling has a create spell as critter... critter->SelectLevel(critter->GetCreatureInfo()); // some summoned creaters have different from 1 DB data for level/hp - critter->SetUInt32Value(UNIT_NPC_FLAGS, critter->GetCreatureInfo()->npcflag); + critter->SetUInt32Value(UNIT_NPC_FLAGS, critter->GetCreatureInfo()->npc_flags); // some mini-pets have quests // set timer for unsummon diff --git a/src/game/Spells/SpellMgr.cpp b/src/game/Spells/SpellMgr.cpp index 29efa5c80..e3752eae2 100644 --- a/src/game/Spells/SpellMgr.cpp +++ b/src/game/Spells/SpellMgr.cpp @@ -3314,9 +3314,9 @@ void SpellMgr::LoadSpellScriptTarget() } if (const CreatureInfo* cInfo = sCreatureStorage.LookupEntry(targetEntry)) { - if (spellId == 30427 && !cInfo->SkinLootId) + if (spellId == 30427 && !cInfo->skinning_loot_id) { - sLog.outErrorDb("Table `spell_script_target` has creature %u as a target of spellid 30427, but this creature has no skinlootid. Gas extraction will not work!", cInfo->Entry); + sLog.outErrorDb("Table `spell_script_target` has creature %u as a target of spellid 30427, but this creature has no skinlootid. Gas extraction will not work!", cInfo->entry); continue; } } diff --git a/src/game/StatSystem.cpp b/src/game/StatSystem.cpp index 5a57034ff..dd0a3d2e6 100644 --- a/src/game/StatSystem.cpp +++ b/src/game/StatSystem.cpp @@ -804,9 +804,9 @@ void Creature::UpdateDamagePhysical(WeaponAttackType attType) * ie if AP is reduced to 0, attack will be reduced of 30% * We have to ignore creatures that don't have AP set in database (we would divide by 0) */ - if (GetCreatureInfo()->attackpower) + if (GetCreatureInfo()->attack_power) { - float databaseAttackPower = GetCreatureInfo()->attackpower; + float databaseAttackPower = GetCreatureInfo()->attack_power; float attackPowerNow = GetTotalAttackPowerValue(attType); weapon_mindamage = weapon_mindamage * (0.7f + 0.3f * attackPowerNow / databaseAttackPower); weapon_maxdamage = weapon_maxdamage * (0.7f + 0.3f * attackPowerNow / databaseAttackPower); diff --git a/src/scripts/CMakeLists.txt b/src/scripts/CMakeLists.txt index 64a683629..72aa2c755 100644 --- a/src/scripts/CMakeLists.txt +++ b/src/scripts/CMakeLists.txt @@ -43,7 +43,6 @@ set (SCRIPTS_SRCS custom/event_attack_city.cpp custom/gmisland.cpp custom/npc_escort.cpp - custom/npc_gobj_spawner.cpp custom/zero_creatures.cpp custom/npc_j_eevee.cpp eastern_kingdoms/alterac_mountains/alterac_mountains.cpp diff --git a/src/scripts/battlegrounds/battleground.cpp b/src/scripts/battlegrounds/battleground.cpp index 1378224a3..7d3a72ba2 100644 --- a/src/scripts/battlegrounds/battleground.cpp +++ b/src/scripts/battlegrounds/battleground.cpp @@ -133,8 +133,8 @@ enum }; /* [SQL] --- ScriptName -UPDATE creature_template SET ScriptName="npc_etendard" WHERE entry IN +-- script_name +UPDATE creature_template SET script_name="npc_etendard" WHERE entry IN ( -- Alliance Alterac 14752, diff --git a/src/scripts/custom/npc_gobj_spawner.cpp b/src/scripts/custom/npc_gobj_spawner.cpp deleted file mode 100644 index 90640dbd7..000000000 --- a/src/scripts/custom/npc_gobj_spawner.cpp +++ /dev/null @@ -1,63 +0,0 @@ -#include "scriptPCH.h" - -// ####################### -// # npc_gobj_spawner # -// ####################### -// Spawn toutes les 1 a 3 min un Gobj avec l'entry du KillCredit0 de la creature. - -struct npc_gobj_spawnerAI : public ScriptedAI -{ - npc_gobj_spawnerAI(Creature* pCreature) : ScriptedAI(pCreature) - { - uiCD = urand(5, 10) * 1000; - uiGobjEntry = pCreature->GetCreatureInfo()->KillCredit[0]; - Reset(); - } - - uint32 uiCD; - uint32 uiGobjEntry; - - void Reset() - { - } - void DoSummonGobj() - { - GameObject* gobj = m_creature->SummonGameObject( - uiGobjEntry, - m_creature->GetPositionX(), - m_creature->GetPositionY(), - m_creature->GetPositionZ(), - m_creature->GetOrientation(), - 0.0f, 0.0f, 0.0f, 0.0f, 25 - ); - if (!gobj) - sLog.outError("Impossible de spawner le gobj [Entry:%u]", uiGobjEntry); - } - void UpdateAI(const uint32 uiDiff) - { - if (!uiGobjEntry) - return; - - if (uiCD < uiDiff) - { - DoSummonGobj(); - uiCD = urand(60, 180) * 1000; - } - else - uiCD -= uiDiff; - } -}; - -CreatureAI* GetAI_npc_gobj_spawner(Creature* pCreature) -{ - return new npc_gobj_spawnerAI(pCreature); -} - -void AddSC_event_nostalrius() -{ - Script* pNewScript; - pNewScript = new Script; - pNewScript->Name = "npc_gobj_spawner"; - pNewScript->GetAI = &GetAI_npc_gobj_spawner; - pNewScript->RegisterSelf(); -} diff --git a/src/scripts/eastern_kingdoms/burning_steppes/blackrock_spire/boss_urok.cpp b/src/scripts/eastern_kingdoms/burning_steppes/blackrock_spire/boss_urok.cpp index ac66a15e0..0e2e7ed3b 100644 --- a/src/scripts/eastern_kingdoms/burning_steppes/blackrock_spire/boss_urok.cpp +++ b/src/scripts/eastern_kingdoms/burning_steppes/blackrock_spire/boss_urok.cpp @@ -322,7 +322,7 @@ struct urokOgreMagusAI : public urokUnderlingAI void abilityCombatUpdate(uint32 uiDiff) { if (!m_CreatureSpells.empty()) - DoSpellTemplateCasts(uiDiff); + DoSpellsListCasts(uiDiff); DoMeleeAttackIfReady(); } diff --git a/src/scripts/eastern_kingdoms/burning_steppes/blackrock_spire/ubrs_trash.cpp b/src/scripts/eastern_kingdoms/burning_steppes/blackrock_spire/ubrs_trash.cpp index 8c701b728..4b1590f64 100644 --- a/src/scripts/eastern_kingdoms/burning_steppes/blackrock_spire/ubrs_trash.cpp +++ b/src/scripts/eastern_kingdoms/burning_steppes/blackrock_spire/ubrs_trash.cpp @@ -216,6 +216,6 @@ void AddSC_ubrs_trash() pNewScript->RegisterSelf(); } /* -UPDATE creature_template SET ScriptName="npc_blackhand_summoner", AIName="" WHERE entry=9818; -UPDATE creature_template SET ScriptName="npc_blackhand_veteran", AIName="" WHERE entry=9819; +UPDATE creature_template SET script_name="npc_blackhand_summoner", ai_name="" WHERE entry=9818; +UPDATE creature_template SET script_name="npc_blackhand_veteran", ai_name="" WHERE entry=9819; */ diff --git a/src/scripts/eastern_kingdoms/burning_steppes/molten_core/boss_magmadar.cpp b/src/scripts/eastern_kingdoms/burning_steppes/molten_core/boss_magmadar.cpp index 1bcd839f3..663aeafa0 100644 --- a/src/scripts/eastern_kingdoms/burning_steppes/molten_core/boss_magmadar.cpp +++ b/src/scripts/eastern_kingdoms/burning_steppes/molten_core/boss_magmadar.cpp @@ -41,10 +41,10 @@ enum }; /* -DELETE FROM creature_template WHERE entry=20006 OR ScriptName="boss_magmadar_lavabomb"; +DELETE FROM creature_template WHERE entry=20006 OR script_name="boss_magmadar_lavabomb"; INSERT INTO creature_template SET entry=20006, modelid_1=11686, modelid_2=11686, name="LavaBomb", subname="Script", minhealth=4000, maxhealth=5000, faction=14, -speed_walk=0.01, speed_run=0.01, ScriptName="boss_magmadar_lavabomb"; +speed_walk=0.01, speed_run=0.01, script_name="boss_magmadar_lavabomb"; */ struct boss_magmadarAI : public ScriptedAI { diff --git a/src/scripts/eastern_kingdoms/burning_steppes/molten_core/boss_majordomo_executus.cpp b/src/scripts/eastern_kingdoms/burning_steppes/molten_core/boss_majordomo_executus.cpp index 53195a5ee..70be05a8c 100644 --- a/src/scripts/eastern_kingdoms/burning_steppes/molten_core/boss_majordomo_executus.cpp +++ b/src/scripts/eastern_kingdoms/burning_steppes/molten_core/boss_majordomo_executus.cpp @@ -145,8 +145,8 @@ struct boss_majordomoAI : public ScriptedAI if ((*itr)->isAlive() && AddVivant > 0) { const CreatureInfo *cinfo = (*itr)->GetCreatureInfo(); - (*itr)->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, cinfo->mindmg + cinfo->mindmg / AddVivant); - (*itr)->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, cinfo->maxdmg + cinfo->maxdmg / AddVivant); + (*itr)->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, cinfo->dmg_min + cinfo->dmg_min / AddVivant); + (*itr)->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, cinfo->dmg_max + cinfo->dmg_max / AddVivant); } } } diff --git a/src/scripts/eastern_kingdoms/eastern_plaguelands/stratholme/instance_stratholme.cpp b/src/scripts/eastern_kingdoms/eastern_plaguelands/stratholme/instance_stratholme.cpp index 479592600..11b40defb 100644 --- a/src/scripts/eastern_kingdoms/eastern_plaguelands/stratholme/instance_stratholme.cpp +++ b/src/scripts/eastern_kingdoms/eastern_plaguelands/stratholme/instance_stratholme.cpp @@ -2,8 +2,8 @@ #include "stratholme.h" /* -UPDATE `creature_template` SET `ScriptName`='mobs_rat_pestifere' WHERE (`entry`='10441'); -UPDATE `gameobject_template` SET `ScriptName`='go_entree_de_service' WHERE (`entry`='175368'); +UPDATE `creature_template` SET `script_name`='mobs_rat_pestifere' WHERE (`entry`='10441'); +UPDATE `gameobject_template` SET `script_name`='go_entree_de_service' WHERE (`entry`='175368'); INSERT INTO `creature_ai_texts` (`entry` ,`content_default` ,`content_loc1` ,`content_loc2` ,`content_loc3` ,`content_loc4` ,`content_loc5` ,`content_loc6` ,`content_loc7` ,`content_loc8` ,`sound` ,`type` ,`language` ,`emote` ,`comment`) VALUES ('-20000', 'Des intrus ! Encore des marionnettes de l''Aube d''argent, sans doute. J''en ai d�j� une parmi mes prisonniers. H�tez-vous de quitter nom domaine, sans quoi elle sera ex�cut�e !', NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , '0', '0', '0', '0', NULL), ('-20001', 'Je vais prendre beaucoup de plaisir � tuer cette pauvre femme ! Il n''est pas trop tard, Il n''est pas n�cessaire qu''elle souffre pour rien. Allez-vous-en et sa mort sera mis�ricordieuse !', NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , '0', '0', '0', '0', NULL), @@ -16,7 +16,7 @@ DELETE FROM gameobject WHERE guid = '82643'; INSERT INTO gameobject VALUES ( 82643, 181071, 329, 4044.34, -3334.22, 115.06, 2.61058, 0, 0, 0.964959, 0.2624, 0, 255, 1); UPDATE creature SET position_x = '4044.34', position_y = '-3334.23', position_z = '115.06', orientation = '4.1421' WHERE id = '16031'; DELETE FROM creature WHERE id = '10558'; -UPDATE `creature_template` SET `MovementType` = '0',`InhabitType` = '4',`ScriptName` = 'mobs_cristal_zuggurat' WHERE `entry` =10415; +UPDATE `creature_template` SET `MovementType` = '0',`InhabitType` = '4',`script_name` = 'mobs_cristal_zuggurat' WHERE `entry` =10415; */ enum diff --git a/src/scripts/eastern_kingdoms/eastern_plaguelands/stratholme/stratholme.cpp b/src/scripts/eastern_kingdoms/eastern_plaguelands/stratholme/stratholme.cpp index 1e00e4e63..89c00a0b0 100644 --- a/src/scripts/eastern_kingdoms/eastern_plaguelands/stratholme/stratholme.cpp +++ b/src/scripts/eastern_kingdoms/eastern_plaguelands/stratholme/stratholme.cpp @@ -677,7 +677,7 @@ struct npc_auriusAI : public ScriptedAI { if (!m_pInstance) return; - ui_entry = (m_creature->GetCreatureInfo()->Entry); + ui_entry = (m_creature->GetCreatureInfo()->entry); if (ui_entry == NPC_AURIUS_1) m_pInstance->SetData(TYPE_EVENT_AURIUS, NOT_STARTED); bIsFakeDead = false; diff --git a/src/scripts/eastern_kingdoms/stranglethorn_vale/zulgurub/boss_arlokk.cpp b/src/scripts/eastern_kingdoms/stranglethorn_vale/zulgurub/boss_arlokk.cpp index 0aefe7176..4e69c08f7 100644 --- a/src/scripts/eastern_kingdoms/stranglethorn_vale/zulgurub/boss_arlokk.cpp +++ b/src/scripts/eastern_kingdoms/stranglethorn_vale/zulgurub/boss_arlokk.cpp @@ -334,8 +334,8 @@ struct boss_arlokkAI : public ScriptedAI m_creature->CastSpell(m_creature, SPELL_PANTHER_TRANSFORM, false); m_creature->SetFloatValue(OBJECT_FIELD_SCALE_X, 1.7f); const CreatureInfo *cinfo = m_creature->GetCreatureInfo(); - m_creature->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg + ((cinfo->mindmg / 100) * 35))); - m_creature->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg + ((cinfo->maxdmg / 100) * 35))); + m_creature->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->dmg_min + ((cinfo->dmg_min / 100) * 35))); + m_creature->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->dmg_max + ((cinfo->dmg_max / 100) * 35))); m_creature->UpdateDamagePhysical(BASE_ATTACK); // Et embush diff --git a/src/scripts/eastern_kingdoms/stranglethorn_vale/zulgurub/boss_jindo.cpp b/src/scripts/eastern_kingdoms/stranglethorn_vale/zulgurub/boss_jindo.cpp index 47c487e57..09a4fe719 100644 --- a/src/scripts/eastern_kingdoms/stranglethorn_vale/zulgurub/boss_jindo.cpp +++ b/src/scripts/eastern_kingdoms/stranglethorn_vale/zulgurub/boss_jindo.cpp @@ -414,7 +414,7 @@ CreatureAI* GetAI_mob_brain_wash(Creature* pCreature) return new mob_brain_wash_totemAI(pCreature); } -// UPDATE `creature_template` SET `AIName` = '', `ScriptName` = 'mob_brain_wash' WHERE `entry` = 15112; +// UPDATE `creature_template` SET `ai_name` = '', `script_name` = 'mob_brain_wash' WHERE `entry` = 15112; void AddSC_boss_jindo() { Script *newscript; diff --git a/src/scripts/eastern_kingdoms/stranglethorn_vale/zulgurub/boss_mandokir.cpp b/src/scripts/eastern_kingdoms/stranglethorn_vale/zulgurub/boss_mandokir.cpp index 865a9f917..25173c0a5 100644 --- a/src/scripts/eastern_kingdoms/stranglethorn_vale/zulgurub/boss_mandokir.cpp +++ b/src/scripts/eastern_kingdoms/stranglethorn_vale/zulgurub/boss_mandokir.cpp @@ -7,7 +7,7 @@ EndScriptData */ /* [SQL] -UPDATE creature_template SET ScriptName="mob_chained_spirit" WHERE entry=15117; +UPDATE creature_template SET script_name="mob_chained_spirit" WHERE entry=15117; */ #include "scriptPCH.h" #include "zulgurub.h" diff --git a/src/scripts/eastern_kingdoms/stranglethorn_vale/zulgurub/boss_marli.cpp b/src/scripts/eastern_kingdoms/stranglethorn_vale/zulgurub/boss_marli.cpp index c132cf8f7..e7b6a24eb 100644 --- a/src/scripts/eastern_kingdoms/stranglethorn_vale/zulgurub/boss_marli.cpp +++ b/src/scripts/eastern_kingdoms/stranglethorn_vale/zulgurub/boss_marli.cpp @@ -302,8 +302,8 @@ struct boss_marliAI : public ScriptedAI DoCastSpellIfCan(m_creature, SPELL_SPIDER_FORM); const CreatureInfo *cinfo = m_creature->GetCreatureInfo(); - m_creature->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg + ((cinfo->mindmg / 100) * 35))); - m_creature->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg + ((cinfo->maxdmg / 100) * 35))); + m_creature->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->dmg_min + ((cinfo->dmg_min / 100) * 35))); + m_creature->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->dmg_max + ((cinfo->dmg_max / 100) * 35))); m_creature->UpdateDamagePhysical(BASE_ATTACK); DoResetThreat(); @@ -320,8 +320,8 @@ struct boss_marliAI : public ScriptedAI m_creature->SetDisplayId(m_uiDefaultModel); const CreatureInfo *cinfo = m_creature->GetCreatureInfo(); - m_creature->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg + ((cinfo->mindmg / 100) * 1))); - m_creature->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg + ((cinfo->maxdmg / 100) * 1))); + m_creature->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->dmg_min + ((cinfo->dmg_min / 100) * 1))); + m_creature->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->dmg_max + ((cinfo->dmg_max / 100) * 1))); m_creature->UpdateDamagePhysical(BASE_ATTACK); m_bIsInPhaseTwo = false; diff --git a/src/scripts/eastern_kingdoms/stranglethorn_vale/zulgurub/boss_thekal.cpp b/src/scripts/eastern_kingdoms/stranglethorn_vale/zulgurub/boss_thekal.cpp index 6c751a771..d38850df4 100644 --- a/src/scripts/eastern_kingdoms/stranglethorn_vale/zulgurub/boss_thekal.cpp +++ b/src/scripts/eastern_kingdoms/stranglethorn_vale/zulgurub/boss_thekal.cpp @@ -393,8 +393,8 @@ struct boss_thekalAI : public zg_rez_add m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); const CreatureInfo *cinfo = m_creature->GetCreatureInfo(); - m_creature->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg + ((cinfo->mindmg / 100) * 40))); - m_creature->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg + ((cinfo->maxdmg / 100) * 40))); + m_creature->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->dmg_min + ((cinfo->dmg_min / 100) * 40))); + m_creature->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->dmg_max + ((cinfo->dmg_max / 100) * 40))); m_creature->UpdateDamagePhysical(BASE_ATTACK); NoTargetReset_Timer = 5000; diff --git a/src/scripts/kalimdor/desolace/maraudon/boss_celebras_the_cursed.cpp b/src/scripts/kalimdor/desolace/maraudon/boss_celebras_the_cursed.cpp index 9c82ee1e8..d3648af29 100644 --- a/src/scripts/kalimdor/desolace/maraudon/boss_celebras_the_cursed.cpp +++ b/src/scripts/kalimdor/desolace/maraudon/boss_celebras_the_cursed.cpp @@ -270,7 +270,7 @@ struct celebrasSpiritAI : public npc_escortAI if (player->GetQuestStatus(QUEST_SCEPTER) == QUEST_STATUS_INCOMPLETE) { player->AreaExploredOrEventHappens(QUEST_SCEPTER); - player->PrepareGossipMenu(m_creature, m_creature->GetCreatureInfo()->GossipMenuId); + player->PrepareGossipMenu(m_creature, m_creature->GetCreatureInfo()->gossip_menu_id); player->SendPreparedGossip(m_creature); } } diff --git a/src/scripts/kalimdor/felwood/felwood.cpp b/src/scripts/kalimdor/felwood/felwood.cpp index 70c6f9cfa..68223a600 100644 --- a/src/scripts/kalimdor/felwood/felwood.cpp +++ b/src/scripts/kalimdor/felwood/felwood.cpp @@ -72,7 +72,7 @@ struct npc_kittenAI : public FollowerAI void MoveInLineOfSight(Unit* pWho) { - //should not have npcflag by default, so set when expected + //should not have npc_flags by default, so set when expected if (!m_creature->getVictim() && !m_creature->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP) && HasFollowState(STATE_FOLLOW_INPROGRESS) && pWho->GetEntry() == NPC_WINNA) { if (m_creature->IsWithinDistInMap(pWho, INTERACTION_DISTANCE)) @@ -115,9 +115,9 @@ bool EffectDummyCreature_npc_kitten(Unit* pCaster, uint32 uiSpellId, SpellEffect // Not nice way, however using UpdateEntry will not be correct. if (const CreatureInfo* pTemp = GetCreatureTemplateStore(NPC_CORRUPT_SABER)) { - pCreatureTarget->SetEntry(pTemp->Entry); + pCreatureTarget->SetEntry(pTemp->entry); pCreatureTarget->SetDisplayId(Creature::ChooseDisplayId(pTemp)); - pCreatureTarget->SetName(pTemp->Name); + pCreatureTarget->SetName(pTemp->name); pCreatureTarget->SetFloatValue(OBJECT_FIELD_SCALE_X, pTemp->scale); } diff --git a/src/scripts/kalimdor/silithus/silithus.cpp b/src/scripts/kalimdor/silithus/silithus.cpp index fb3dc40fd..0bfb38c31 100644 --- a/src/scripts/kalimdor/silithus/silithus.cpp +++ b/src/scripts/kalimdor/silithus/silithus.cpp @@ -956,7 +956,7 @@ CreatureAI* GetAI_npc_colossus(Creature* pCreature) /*UPDATE `gameobject_template` SET `size` = 1.5, `data2` = 39321600, `type` = 1 WHERE `entry` = 210342; UPDATE `gameobject_template` SET data2 = 39321600 WHERE `entry` = 180514; DELETE FROM `gameobject` WHERE `id` IN (180514, 210342); - UPDATE `creature_template` SET `ScriptName` = 'npc_Geologist_Larksbane' WHERE `entry` = 15183;*/ + UPDATE `creature_template` SET `script_name` = 'npc_Geologist_Larksbane' WHERE `entry` = 15183;*/ enum { @@ -1248,9 +1248,9 @@ bool QuestComplete_npc_Geologist_Larksbane(Player* pPlayer, Creature* pQuestGive ###*/ /* - UPDATE `creature_template` SET `minmana` = 432240, `maxmana` = 434240, `armor` = 3769, `speed_walk` = 1.24, `speed_run` = 1.24, `baseattacktime` = 1280, + UPDATE `creature_template` SET `minmana` = 432240, `maxmana` = 434240, `armor` = 3769, `speed_walk` = 1.24, `speed_run` = 1.24, `base_attack_time` = 1280, `resistance1` = 0, `mingold` = 4031, `maxgold` = 4031, `mechanic_immune_mask` = 650854367, `MovementType` = 1, - `ScriptName` = 'npc_Emissary_Romankhan' WHERE `entry` = 14862; + `script_name` = 'npc_Emissary_Romankhan' WHERE `entry` = 14862; */ enum diff --git a/src/scripts/kalimdor/thousand_needles/thousand_needles.cpp b/src/scripts/kalimdor/thousand_needles/thousand_needles.cpp index 8c0bc1119..dd9ab5dff 100644 --- a/src/scripts/kalimdor/thousand_needles/thousand_needles.cpp +++ b/src/scripts/kalimdor/thousand_needles/thousand_needles.cpp @@ -388,7 +388,7 @@ bool GossipSelect_npc_plucky_johnson(Player* pPlayer, Creature* pCreature, uint3 /* [SQL] -UPDATE gameobject_template SET ScriptName="go_panther_cage" WHERE entry=176195; +UPDATE gameobject_template SET script_name="go_panther_cage" WHERE entry=176195; */ enum ePantherCage diff --git a/src/scripts/world/go_scripts.cpp b/src/scripts/world/go_scripts.cpp index 47cdfbe80..a94665cd7 100644 --- a/src/scripts/world/go_scripts.cpp +++ b/src/scripts/world/go_scripts.cpp @@ -309,8 +309,8 @@ bool GOHello_go_silithyste(Player* pPlayer, GameObject* pGo) ###### SQL : UPDATE quest_template SET QuestFlags = QuestFlags | 2, SpecialFlags = SpecialFlags | 2 WHERE entry = 3821; -UPDATE gameobject_template SET ScriptName="go_restes_sha_ni" WHERE entry=160445; -UPDATE creature_template SET npcflag = 0 WHERE entry=9136; +UPDATE gameobject_template SET script_name="go_restes_sha_ni" WHERE entry=160445; +UPDATE creature_template SET npc_flags = 0 WHERE entry=9136; */ bool GOHello_go_restes_sha_ni(Player* pPlayer, GameObject* pGo) diff --git a/src/scripts/world/world_event_wareffort.cpp b/src/scripts/world/world_event_wareffort.cpp index 984ddad45..e015c6b19 100644 --- a/src/scripts/world/world_event_wareffort.cpp +++ b/src/scripts/world/world_event_wareffort.cpp @@ -284,7 +284,7 @@ WarEffortGameEvents GetActiveTransportEvent() ## npc_AQwar_collector ###*/ -// UPDATE `creature_template` SET `ScriptName` = 'npc_AQwar_collector' WHERE `subname` like '%collector%' and subname not like '%ancestry%'; +// UPDATE `creature_template` SET `script_name` = 'npc_AQwar_collector' WHERE `subname` like '%collector%' and subname not like '%ancestry%'; struct npc_AQwar_collectorAI : CreatureAI { @@ -728,7 +728,7 @@ CreatureAI *GetAI_npc_AQwar_collector(Creature *pCreature) ## npc_resonating_Crystal ######*/ -// UPDATE `creature_template` SET `ScriptName` = 'npc_resonating_Crystal' WHERE `entry` = 15769; +// UPDATE `creature_template` SET `script_name` = 'npc_resonating_Crystal' WHERE `entry` = 15769; enum {