Core/Creatures: Reworked setting move types in database (ported commit: 592516ae69d89da3bcb0ede144644a3d2e0186e0)

*merged followup commits
This commit is contained in:
Ovahlord committed 2019-02-18 07:52:25 +01:00
1 parent f763095de9
commit 9ce72fa1d9
12 files changed
+233 -46

No files matched your search

@@ -0,0 +1,7 @@
DELETE FROM `rbac_permissions` WHERE `id` = 873;
INSERT INTO `rbac_permissions` (`id`,`name`) VALUES
(873, 'Command: reload creature_movement_override');
DELETE FROM `rbac_linked_permissions` WHERE `linkedId` = 873;
INSERT INTO `rbac_linked_permissions` (`id`,`linkedId`) VALUES
(196, 873);
@@ -0,0 +1,34 @@
DROP TABLE IF EXISTS `creature_template_movement`;
CREATE TABLE `creature_template_movement` (
`CreatureId` int(10) unsigned NOT NULL DEFAULT '0',
`Ground` tinyint(3) unsigned NOT NULL DEFAULT '1',
`Swim` tinyint(3) unsigned NOT NULL DEFAULT '1',
`Flight` tinyint(3) unsigned NOT NULL DEFAULT '0',
`Rooted` tinyint(3) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`CreatureId`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `creature_movement_override`;
CREATE TABLE `creature_movement_override` (
`SpawnId` int(10) unsigned NOT NULL DEFAULT '0',
`Ground` tinyint(3) unsigned NOT NULL DEFAULT '1',
`Swim` tinyint(3) unsigned NOT NULL DEFAULT '1',
`Flight` tinyint(3) unsigned NOT NULL DEFAULT '0',
`Rooted` tinyint(3) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`SpawnId`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
INSERT INTO `creature_template_movement` SELECT `entry`,0,0,0,0 FROM `creature_template` WHERE `InhabitType`!=3;
UPDATE `creature_template_movement` SET `Ground`=1 WHERE `CreatureId` IN (SELECT `entry` FROM `creature_template` WHERE `InhabitType` & 1);
UPDATE `creature_template_movement` SET `Swim`=1 WHERE `CreatureId` IN (SELECT `entry` FROM `creature_template` WHERE `InhabitType` & 2);
UPDATE `creature_template_movement` SET `Flight`=1 WHERE `CreatureId` IN (SELECT `entry` FROM `creature_template` WHERE (`InhabitType` & 5) = 4);
UPDATE `creature_template_movement` SET `Flight`=2 WHERE `CreatureId` IN (SELECT `entry` FROM `creature_template` WHERE (`InhabitType` & 5) = 5);
UPDATE `creature_template_movement` SET `Rooted`=1 WHERE `CreatureId` IN (SELECT `entry` FROM `creature_template` WHERE `InhabitType` & 8);
ALTER TABLE `creature_template` DROP `InhabitType`;
UPDATE `trinity_string` SET `content_default`='Movement type: %s' WHERE `entry`=11008;
DELETE FROM `command` WHERE `name`='reload creature_movement_override';
INSERT INTO `command` (`name`,`permission`,`help`) VALUES
('reload creature_movement_override',873,'Syntax: .reload creature_movement_override\nReload creature_movement_override table.');
@@ -77,7 +77,7 @@ void WorldDatabaseConnection::DoPrepareStatements()
PrepareStatement(WORLD_SEL_WAYPOINT_SCRIPT_ID_BY_GUID, "SELECT id FROM waypoint_scripts WHERE guid = ?", CONNECTION_SYNCH);
PrepareStatement(WORLD_DEL_CREATURE, "DELETE FROM creature WHERE guid = ?", CONNECTION_ASYNC);
PrepareStatement(WORLD_SEL_COMMANDS, "SELECT name, permission, help FROM command", CONNECTION_SYNCH);
PrepareStatement(WORLD_SEL_CREATURE_TEMPLATE, "SELECT entry, difficulty_entry_1, difficulty_entry_2, difficulty_entry_3, KillCredit1, KillCredit2, modelid1, modelid2, modelid3, modelid4, name, femaleName, subname, IconName, gossip_menu_id, minlevel, maxlevel, exp, exp_unk, faction, npcflag, speed_walk, speed_run, scale, `rank`, dmgschool, BaseAttackTime, RangeAttackTime, BaseVariance, RangeVariance, unit_class, unit_flags, unit_flags2, dynamicflags, family, trainer_type, trainer_class, trainer_race, type, type_flags, type_flags2, lootid, pickpocketloot, skinloot, resistance1, resistance2, resistance3, resistance4, resistance5, resistance6, spell1, spell2, spell3, spell4, spell5, spell6, spell7, spell8, PetSpellDataId, VehicleId, mingold, maxgold, AIName, MovementType, InhabitType, HoverHeight, HealthModifier, HealthModifierExtra, ManaModifier, ManaModifierExtra, ArmorModifier, DamageModifier, ExperienceModifier, RacialLeader, movementId, RegenHealth, mechanic_immune_mask, spell_school_immune_mask, flags_extra, ScriptName FROM creature_template WHERE entry = ?", CONNECTION_SYNCH);
PrepareStatement(WORLD_SEL_CREATURE_TEMPLATE, "SELECT entry, difficulty_entry_1, difficulty_entry_2, difficulty_entry_3, KillCredit1, KillCredit2, modelid1, modelid2, modelid3, modelid4, name, femaleName, subname, IconName, gossip_menu_id, minlevel, maxlevel, exp, exp_unk, faction, npcflag, speed_walk, speed_run, scale, `rank`, dmgschool, BaseAttackTime, RangeAttackTime, BaseVariance, RangeVariance, unit_class, unit_flags, unit_flags2, dynamicflags, family, trainer_type, trainer_class, trainer_race, type, type_flags, type_flags2, lootid, pickpocketloot, skinloot, resistance1, resistance2, resistance3, resistance4, resistance5, resistance6, spell1, spell2, spell3, spell4, spell5, spell6, spell7, spell8, PetSpellDataId, VehicleId, mingold, maxgold, AIName, MovementType, ctm.Ground, ctm.Swim, ctm.Flight, ctm.Rooted, HoverHeight, HealthModifier, HealthModifierExtra, ManaModifier, ManaModifierExtra, ArmorModifier, DamageModifier, ExperienceModifier, RacialLeader, movementId, RegenHealth, mechanic_immune_mask, spell_school_immune_mask, flags_extra, ScriptName FROM creature_template ct LEFT JOIN creature_template_movement ctm ON ct.entry = ctm.CreatureId WHERE entry = ?", CONNECTION_SYNCH);
PrepareStatement(WORLD_SEL_WAYPOINT_SCRIPT_BY_ID, "SELECT guid, delay, command, datalong, datalong2, dataint, x, y, z, o FROM waypoint_scripts WHERE id = ?", CONNECTION_SYNCH);
PrepareStatement(WORLD_SEL_ITEM_TEMPLATE_BY_NAME, "SELECT entry FROM item_template WHERE name = ?", CONNECTION_SYNCH);
PrepareStatement(WORLD_SEL_CREATURE_BY_ID, "SELECT guid FROM creature WHERE id = ?", CONNECTION_SYNCH);
+39 -14
View File
@@ -54,6 +54,22 @@
#include "WorldPacket.h"
#include <G3D/g3dmath.h>
std::string CreatureMovementData::ToString() const
{
char const* const GroundStates[] = { "None", "Run", "Hover" };
char const* const FlightStates[] = { "None", "DisableGravity", "CanFly" };
std::ostringstream str;
str << std::boolalpha
<< "Ground: " << GroundStates[AsUnderlyingType(Ground)]
<< ", Swim: " << Swim
<< ", Flight: " << FlightStates[AsUnderlyingType(Flight)];
if (Rooted)
str << ", Rooted";
return str.str();
}
TrainerSpell const* TrainerSpellData::Find(uint32 spell_id) const
{
TrainerSpellMap::const_iterator itr = spellList.find(spell_id);
@@ -562,7 +578,7 @@ bool Creature::UpdateEntry(uint32 entry, CreatureData const* data /*= nullptr*/,
ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_ATTACK_ME, true);
}
if (cInfo->InhabitType & INHABIT_ROOT)
if (GetMovementTemplate().IsRooted())
SetControlled(true, UNIT_STATE_ROOT);
UpdateMovementFlags();
@@ -2431,7 +2447,7 @@ bool Creature::LoadCreaturesAddon()
//! Check using InhabitType as movement flags are assigned dynamically
//! basing on whether the creature is in air or not
//! Set MovementFlag_Hover. Otherwise do nothing.
if (GetByteValue(UNIT_FIELD_BYTES_1, UNIT_BYTES_1_OFFSET_ANIM_TIER) & UNIT_BYTE1_FLAG_HOVER && !(GetCreatureTemplate()->InhabitType & INHABIT_AIR))
if (CanHover())
AddUnitMovementFlag(MOVEMENTFLAG_HOVER);
}
@@ -2578,6 +2594,14 @@ void Creature::GetRespawnPosition(float &x, float &y, float &z, float* ori, floa
}
}
CreatureMovementData const& Creature::GetMovementTemplate() const
{
if (CreatureMovementData const* movementOverride = sObjectMgr->GetCreatureMovementOverride(m_spawnId))
return *movementOverride;
return GetCreatureTemplate()->Movement;
}
void Creature::AllLootRemovedFromCorpse()
{
if (loot.loot_type != LOOT_SKINNING && !IsPet() && GetCreatureTemplate()->SkinLootId && hasLootRecipient())
@@ -2867,34 +2891,35 @@ void Creature::UpdateMovementFlags()
// Set the movement flags if the creature is in that mode. (Only fly if actually in air, only swim if in water, etc)
float ground = GetFloorZ();
bool isInAir = (G3D::fuzzyGt(GetPositionZ(), ground + GROUND_HEIGHT_TOLERANCE) || G3D::fuzzyLt(GetPositionZ(), ground - GROUND_HEIGHT_TOLERANCE)); // Can be underground too, prevent the falling
bool canHover = CanHover();
bool isInAir = (G3D::fuzzyGt(GetPositionZ(), ground + (canHover ? GetFloatValue(UNIT_FIELD_HOVERHEIGHT) : 0.0f) + GROUND_HEIGHT_TOLERANCE) || G3D::fuzzyLt(GetPositionZ(), ground - GROUND_HEIGHT_TOLERANCE)); // Can be underground too, prevent the falling
if (GetCreatureTemplate()->InhabitType & INHABIT_AIR && isInAir && !IsFalling())
if (GetMovementTemplate().IsFlightAllowed() && isInAir && !IsFalling())
{
if (GetCreatureTemplate()->InhabitType & INHABIT_GROUND)
if (GetMovementTemplate().Flight == CreatureFlightMovementType::CanFly)
SetCanFly(true);
else
SetDisableGravity(true);
if (!HasAuraType(SPELL_AURA_HOVER))
SetHover(false);
}
else
{
SetCanFly(false);
SetDisableGravity(false);
if (IsAlive() && CanHover() || HasAuraType(SPELL_AURA_HOVER))
SetHover(true);
}
if (!isInAir)
SetFall(false);
RemoveUnitMovementFlag(MOVEMENTFLAG_FALLING);
if (GetCreatureTemplate()->InhabitType & INHABIT_WATER)
if (GetMovementTemplate().IsSwimAllowed())
{
if (IsUnderWater())
AddUnitMovementFlag(MOVEMENTFLAG_DISABLE_GRAVITY);
else
RemoveUnitMovementFlag(MOVEMENTFLAG_DISABLE_GRAVITY);
SetSwim(IsInWater());
SetDisableGravity(IsUnderWater());
}
else
SetSwim(GetCreatureTemplate()->InhabitType & INHABIT_WATER && IsInWater());
}
void Creature::SetObjectScale(float scale)
+6 -3
View File
@@ -92,9 +92,12 @@ class TC_GAME_API Creature : public Unit, public GridObject<Creature>, public Ma
bool IsCivilian() const { return (GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_CIVILIAN) != 0; }
bool IsTrigger() const { return (GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_TRIGGER) != 0; }
bool IsGuard() const { return (GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_GUARD) != 0; }
bool CanWalk() const { return (GetCreatureTemplate()->InhabitType & INHABIT_GROUND) != 0; }
bool CanSwim() const override { return (GetCreatureTemplate()->InhabitType & INHABIT_WATER) != 0 || IsPet(); }
bool CanFly() const override { return (GetCreatureTemplate()->InhabitType & INHABIT_AIR) != 0; }
CreatureMovementData const& GetMovementTemplate() const;
bool CanWalk() const { return GetMovementTemplate().IsGroundAllowed(); }
bool CanSwim() const override { return GetMovementTemplate().IsSwimAllowed() || IsPet(); }
bool CanFly() const override { return GetMovementTemplate().IsFlightAllowed(); }
bool CanHover() const { return GetMovementTemplate().Ground == CreatureGroundMovementType::Hover; }
bool IsDungeonBoss() const { return (GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_DUNGEON_BOSS) != 0; }
bool IsAffectedByDiminishingReturns() const override { return Unit::IsAffectedByDiminishingReturns() || (GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_ALL_DIMINISH) != 0; }
@@ -74,6 +74,41 @@ enum CreatureFlagsExtra : uint32
CREATURE_FLAG_EXTRA_DB_ALLOWED = (0xFFFFFFFF & ~(CREATURE_FLAG_EXTRA_UNUSED | CREATURE_FLAG_EXTRA_DUNGEON_BOSS))
};
enum class CreatureGroundMovementType : uint8
{
None,
Run,
Hover,
Max
};
enum class CreatureFlightMovementType : uint8
{
None,
DisableGravity,
CanFly,
Max
};
struct TC_GAME_API CreatureMovementData
{
CreatureMovementData() : Ground(CreatureGroundMovementType::Run), Flight(CreatureFlightMovementType::None), Swim(true), Rooted(false) { }
CreatureGroundMovementType Ground;
CreatureFlightMovementType Flight;
bool Swim;
bool Rooted;
bool IsGroundAllowed() const { return Ground != CreatureGroundMovementType::None; }
bool IsSwimAllowed() const { return Swim; }
bool IsFlightAllowed() const { return Flight != CreatureFlightMovementType::None; }
bool IsRooted() const { return Rooted; }
std::string ToString() const;
};
static uint32 const CREATURE_REGEN_INTERVAL = 2 * IN_MILLISECONDS;
static uint32 const CREATURE_NOPATH_EVADE_TIME = 5 * IN_MILLISECONDS;
@@ -134,7 +169,7 @@ struct TC_GAME_API CreatureTemplate
uint32 maxgold;
std::string AIName;
uint32 MovementType;
uint32 InhabitType;
CreatureMovementData Movement;
float HoverHeight;
float ModHealth;
float ModHealthExtra;
+91 -25
View File
@@ -441,10 +441,12 @@ void ObjectMgr::LoadCreatureTemplates()
"type_flags, type_flags2, lootid, pickpocketloot, skinloot, resistance1, resistance2, resistance3, resistance4, resistance5, resistance6, "
// 50 51 52 53 54 55 56 57 58 59 60 61 62 63
"spell1, spell2, spell3, spell4, spell5, spell6, spell7, spell8, PetSpellDataId, VehicleId, mingold, maxgold, AIName, MovementType, "
// 64 65 66 67 68 69 70 71 72
"InhabitType, HoverHeight, HealthModifier, HealthModifierExtra, ManaModifier, ManaModifierExtra, ArmorModifier, DamageModifier, ExperienceModifier, "
// 73 74 75 76 77 78 79
"RacialLeader, movementId, RegenHealth, mechanic_immune_mask, spell_school_immune_mask, flags_extra, ScriptName FROM creature_template");
// 64 65 66 67 68 69 70 71 72
"ctm.Ground, ctm.Swim, ctm.Flight, ctm.Rooted, HoverHeight, HealthModifier, HealthModifierExtra, ManaModifier, ManaModifierExtra, "
// 73 74 75 76 77 78 79 80
"ArmorModifier, DamageModifier, ExperienceModifier, RacialLeader, movementId, RegenHealth, mechanic_immune_mask, spell_school_immune_mask, "
// 81 82
"flags_extra, ScriptName FROM creature_template ct LEFT JOIN creature_template_movement ctm ON ct.entry = ctm.CreatureId");
if (!result)
{
@@ -532,23 +534,34 @@ void ObjectMgr::LoadCreatureTemplate(Field* fields)
creatureTemplate.maxgold = fields[61].GetUInt32();
creatureTemplate.AIName = fields[62].GetString();
creatureTemplate.MovementType = uint32(fields[63].GetUInt8());
creatureTemplate.InhabitType = uint32(fields[64].GetUInt8());
creatureTemplate.HoverHeight = fields[65].GetFloat();
creatureTemplate.ModHealth = fields[66].GetFloat();
creatureTemplate.ModHealthExtra = fields[67].GetFloat();
creatureTemplate.ModMana = fields[68].GetFloat();
creatureTemplate.ModManaExtra = fields[69].GetFloat();
creatureTemplate.ModArmor = fields[70].GetFloat();
creatureTemplate.ModDamage = fields[71].GetFloat();
creatureTemplate.ModExperience = fields[72].GetFloat();
if (!fields[64].IsNull())
creatureTemplate.Movement.Ground = static_cast<CreatureGroundMovementType>(fields[64].GetUInt8());
creatureTemplate.RacialLeader = fields[73].GetBool();
creatureTemplate.movementId = fields[74].GetUInt32();
creatureTemplate.RegenHealth = fields[75].GetBool();
creatureTemplate.MechanicImmuneMask = fields[76].GetUInt32();
creatureTemplate.SpellSchoolImmuneMask = fields[77].GetUInt32();
creatureTemplate.flags_extra = fields[78].GetUInt32();
creatureTemplate.ScriptID = GetScriptId(fields[79].GetCString());
if (!fields[65].IsNull())
creatureTemplate.Movement.Swim = fields[65].GetBool();
if (!fields[66].IsNull())
creatureTemplate.Movement.Flight = static_cast<CreatureFlightMovementType>(fields[66].GetUInt8());
if (!fields[67].IsNull())
creatureTemplate.Movement.Rooted = fields[67].GetBool();
creatureTemplate.HoverHeight = fields[68].GetFloat();
creatureTemplate.ModHealth = fields[69].GetFloat();
creatureTemplate.ModHealthExtra = fields[70].GetFloat();
creatureTemplate.ModMana = fields[71].GetFloat();
creatureTemplate.ModManaExtra = fields[72].GetFloat();
creatureTemplate.ModArmor = fields[73].GetFloat();
creatureTemplate.ModDamage = fields[74].GetFloat();
creatureTemplate.ModExperience = fields[75].GetFloat();
creatureTemplate.RacialLeader = fields[76].GetBool();
creatureTemplate.movementId = fields[77].GetUInt32();
creatureTemplate.RegenHealth = fields[78].GetBool();
creatureTemplate.MechanicImmuneMask = fields[79].GetUInt32();
creatureTemplate.SpellSchoolImmuneMask = fields[80].GetUInt32();
creatureTemplate.flags_extra = fields[81].GetUInt32();
creatureTemplate.ScriptID = GetScriptId(fields[82].GetCString());
}
void ObjectMgr::LoadCreatureTemplateAddons()
@@ -1077,11 +1090,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
const_cast<CreatureTemplate*>(cInfo)->family = CREATURE_FAMILY_NONE;
}
if (cInfo->InhabitType <= 0 || cInfo->InhabitType > INHABIT_ANYWHERE)
{
TC_LOG_ERROR("sql.sql", "Creature (Entry: %u) has wrong value (%u) in `InhabitType`, creature will not correctly walk/swim/fly.", cInfo->Entry, cInfo->InhabitType);
const_cast<CreatureTemplate*>(cInfo)->InhabitType = INHABIT_ANYWHERE;
}
CheckCreatureMovement("creature_template_movement", cInfo->Entry, const_cast<CreatureTemplate*>(cInfo)->Movement);
if (cInfo->HoverHeight < 0.0f)
{
@@ -1151,6 +1160,23 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
const_cast<CreatureTemplate*>(cInfo)->ModDamage *= Creature::_GetDamageMod(cInfo->rank);
}
void ObjectMgr::CheckCreatureMovement(char const* table, uint64 id, CreatureMovementData& creatureMovement)
{
if (creatureMovement.Ground >= CreatureGroundMovementType::Max)
{
TC_LOG_ERROR("sql.sql", "`%s`.`Ground` wrong value (%u) for Id " UI64FMTD ", setting to Run.",
table, uint32(creatureMovement.Ground), id);
creatureMovement.Ground = CreatureGroundMovementType::Run;
}
if (creatureMovement.Flight >= CreatureFlightMovementType::Max)
{
TC_LOG_ERROR("sql.sql", "`%s`.`Flight` wrong value (%u) for Id " UI64FMTD ", setting to None.",
table, uint32(creatureMovement.Flight), id);
creatureMovement.Flight = CreatureFlightMovementType::None;
}
}
void ObjectMgr::LoadCreatureAddons()
{
uint32 oldMSTime = getMSTime();
@@ -1351,6 +1377,11 @@ CreatureAddon const* ObjectMgr::GetCreatureTemplateAddon(uint32 entry) const
return nullptr;
}
CreatureMovementData const* ObjectMgr::GetCreatureMovementOverride(ObjectGuid::LowType spawnId) const
{
return Trinity::Containers::MapGetValuePtr(_creatureMovementOverrides, spawnId);
}
EquipmentInfo const* ObjectMgr::GetEquipmentInfo(uint32 entry, int8& id) const
{
EquipmentInfoContainer::const_iterator itr = _equipmentInfoStore.find(entry);
@@ -1454,6 +1485,41 @@ void ObjectMgr::LoadEquipmentTemplates()
TC_LOG_INFO("server.loading", ">> Loaded %u equipment templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
void ObjectMgr::LoadCreatureMovementOverrides()
{
uint32 oldMSTime = getMSTime();
_creatureMovementOverrides.clear();
QueryResult result = WorldDatabase.Query("SELECT SpawnId, Ground, Swim, Flight, Rooted from creature_movement_override");
if (!result)
{
TC_LOG_INFO("server.loading", ">> Loaded 0 creature movement overrides. DB table `creature_movement_override` is empty!");
return;
}
do
{
Field* fields = result->Fetch();
ObjectGuid::LowType spawnId = fields[0].GetUInt32();
if (!GetCreatureData(spawnId))
{
TC_LOG_ERROR("sql.sql", "Creature (GUID: %u) does not exist but has a record in `creature_movement_override`", spawnId);
continue;
}
CreatureMovementData& movement = _creatureMovementOverrides[spawnId];
movement.Ground = static_cast<CreatureGroundMovementType>(fields[1].GetUInt8());
movement.Swim = fields[2].GetBool();
movement.Flight = static_cast<CreatureFlightMovementType>(fields[3].GetUInt8());
movement.Rooted = fields[4].GetBool();
CheckCreatureMovement("creature_movement_override", spawnId, movement);
} while (result->NextRow());
TC_LOG_INFO("server.loading", ">> Loaded " SZFMTD " movement overrides in %u ms", _creatureMovementOverrides.size(), GetMSTimeDiffToNow(oldMSTime));
}
CreatureModelInfo const* ObjectMgr::GetCreatureModelInfo(uint32 modelId) const
{
CreatureModelContainer::const_iterator itr = _creatureModelStore.find(modelId);
+4
View File
@@ -948,6 +948,7 @@ class TC_GAME_API ObjectMgr
GameObjectAddon const* GetGameObjectAddon(ObjectGuid::LowType lowguid) const;
GameObjectTemplateAddon const* GetGameObjectTemplateAddon(uint32 entry) const;
CreatureAddon const* GetCreatureTemplateAddon(uint32 entry) const;
CreatureMovementData const* GetCreatureMovementOverride(ObjectGuid::LowType spawnId) const;
ItemTemplate const* GetItemTemplate(uint32 entry) const;
ItemTemplateContainer const* GetItemTemplateStore() const { return &_itemTemplateStore; }
@@ -1142,6 +1143,7 @@ class TC_GAME_API ObjectMgr
void LoadCreatureSparringTemplate();
void LoadCreatureTemplate(Field* fields);
void CheckCreatureTemplate(CreatureTemplate const* cInfo);
void CheckCreatureMovement(char const* table, uint64 id, CreatureMovementData& creatureMovement);
void LoadGameObjectQuestItems();
void LoadCreatureQuestItems();
void LoadTempSummons();
@@ -1152,6 +1154,7 @@ class TC_GAME_API ObjectMgr
void LoadGameObjectAddons();
void LoadCreatureModelInfo();
void LoadEquipmentTemplates();
void LoadCreatureMovementOverrides();
void LoadGameObjectLocales();
void LoadGameObjects();
void LoadSpawnGroupTemplates();
@@ -1706,6 +1709,7 @@ class TC_GAME_API ObjectMgr
CreatureAddonContainer _creatureAddonStore;
CreatureTemplateAddonContainer _creatureTemplateAddonStore;
CreatureSparringTemplateMap _creatureSparringTemplateStore;
std::unordered_map<ObjectGuid::LowType, CreatureMovementData> _creatureMovementOverrides;
GameObjectAddonContainer _gameObjectAddonStore;
GameObjectQuestItemMap _gameObjectQuestItemStore;
CreatureQuestItemMap _creatureQuestItemStore;
+1 -1
View File
@@ -1151,7 +1151,7 @@ enum TrinityStrings
LANG_BAN_ACCOUNT_YOUBANNEDMESSAGE_WORLD = 11006,
LANG_BAN_ACCOUNT_YOUPERMBANNEDMESSAGE_WORLD = 11007,
LANG_NPCINFO_INHABIT_TYPE = 11008,
LANG_NPCINFO_MOVEMENT_DATA = 11008,
LANG_NPCINFO_FLAGS_EXTRA = 11009,
LANG_INSTANCE_LOGIN_GAMEMASTER_EXCEPTION = 11010,
+3
View File
@@ -1831,6 +1831,9 @@ void World::SetInitialWorldSettings()
TC_LOG_INFO("server.loading", "Loading Creature Addon Data...");
sObjectMgr->LoadCreatureAddons(); // must be after LoadCreatureTemplates() and LoadCreatures()
TC_LOG_INFO("server.loading", "Loading Creature Movement Overrides...");
sObjectMgr->LoadCreatureMovementOverrides(); // must be after LoadCreatures()
TC_LOG_INFO("server.loading", "Loading Gameobject Data...");
sObjectMgr->LoadGameObjects();
+1 -1
View File
@@ -801,7 +801,7 @@ public:
handler->PSendSysMessage(LANG_NPCINFO_LEVEL, target->getLevel());
handler->PSendSysMessage(LANG_NPCINFO_EQUIPMENT, target->GetCurrentEquipmentId(), target->GetOriginalEquipmentId());
handler->PSendSysMessage(LANG_NPCINFO_HEALTH, target->GetCreateHealth(), target->GetMaxHealth(), target->GetHealth());
handler->PSendSysMessage(LANG_NPCINFO_INHABIT_TYPE, cInfo->InhabitType);
handler->PSendSysMessage(LANG_NPCINFO_MOVEMENT_DATA, target->GetMovementTemplate().ToString().c_str());
handler->PSendSysMessage(LANG_NPCINFO_UNIT_FIELD_FLAGS, target->GetUInt32Value(UNIT_FIELD_FLAGS));
for (uint8 i = 0; i < MAX_UNIT_FLAGS; ++i)
+10
View File
@@ -88,6 +88,7 @@ public:
{ "creature_questender", rbac::RBAC_PERM_COMMAND_RELOAD_CREATURE_QUESTENDER, true, &HandleReloadCreatureQuestEnderCommand, "" },
{ "creature_linked_respawn", rbac::RBAC_PERM_COMMAND_RELOAD_CREATURE_LINKED_RESPAWN, true, &HandleReloadLinkedRespawnCommand, "" },
{ "creature_loot_template", rbac::RBAC_PERM_COMMAND_RELOAD_CREATURE_LOOT_TEMPLATE, true, &HandleReloadLootTemplatesCreatureCommand, "" },
{ "creature_movement_override", rbac::RBAC_PERM_COMMAND_RELOAD_CREATURE_MOVEMENT_OVERRIDE, true, &HandleReloadCreatureMovementOverrideCommand, "" },
{ "creature_onkill_reward", rbac::RBAC_PERM_COMMAND_RELOAD_CREATURE_ONKILL_REWARD, true, &HandleReloadOnKillRewardCommand, "" },
{ "creature_queststarter", rbac::RBAC_PERM_COMMAND_RELOAD_CREATURE_QUESTSTARTER, true, &HandleReloadCreatureQuestStarterCommand, "" },
{ "creature_summon_groups", rbac::RBAC_PERM_COMMAND_RELOAD_CREATURE_SUMMON_GROUPS, true, &HandleReloadCreatureSummonGroupsCommand, "" },
@@ -196,6 +197,7 @@ public:
HandleReloadTrinityStringCommand(handler, "");
HandleReloadGameTeleCommand(handler, "");
HandleReloadCreatureMovementOverrideCommand(handler, "");
HandleReloadCreatureSummonGroupsCommand(handler, "");
HandleReloadVehicleAccessoryCommand(handler, "");
@@ -562,6 +564,14 @@ public:
return true;
}
static bool HandleReloadCreatureMovementOverrideCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading Creature movement overrides...");
sObjectMgr->LoadCreatureMovementOverrides();
handler->SendGlobalGMSysMessage("DB table `creature_movement_override` reloaded.");
return true;
}
static bool HandleReloadLootTemplatesDisenchantCommand(ChatHandler* handler, char const* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading Loot Tables... (`disenchant_loot_template`)");