fix config (#14)

feat(CPP/DB): fix config parameters; use new cmake macros; take over preferences, templates, scripts etc. from the skeleton module; replace NPC text IDs

- fix config parameters "Transmogrification.AllowMixedArmorTypes" and "Transmogrification.AllowMixedWeaponTypes"
- replace NPC text IDs:
  500000 -> 601083
  500001 -> 601084
This commit is contained in:
Stoabrogga
2019-01-26 19:30:06 +01:00
committed by GitHub
parent 4a34d00874
commit 9adab60983
12 changed files with 190 additions and 39 deletions

View File

@@ -1,8 +0,0 @@
CU_SET_PATH("CMAKE_TRANSM_SRC_DIR" "${CMAKE_CURRENT_LIST_DIR}")
AC_ADD_SCRIPT("${CMAKE_TRANSM_SRC_DIR}/transmog_scripts.cpp")
AC_ADD_SCRIPT("${CMAKE_TRANSM_SRC_DIR}/Transmogrification.cpp")
CU_ADD_HOOK(AFTER_WORLDSERVER_CMAKE "${CMAKE_TRANSM_SRC_DIR}/cmake/after_ws.cmake")
AC_ADD_SCRIPT_LOADER("Transmog" "${CMAKE_TRANSM_SRC_DIR}/transmog_scripts_loader.h")

View File

@@ -460,8 +460,17 @@ bool Transmogrification::SuitableForTransmogrification(Player* player, ItemTempl
return true;
//[AZTH] Yehonal
if (/*TODO: conf here*/ proto->SubClass>0 && player->GetSkillValue(proto->GetSkill()) == 0)
return false;
if (proto->SubClass > 0 && player->GetSkillValue(proto->GetSkill()) == 0)
{
if (proto->Class == ITEM_CLASS_ARMOR)
if (!AllowMixedArmorTypes)
return false;
else if (proto->Class == ITEM_CLASS_WEAPON)
if (!AllowMixedWeaponTypes)
return false;
else
return false;
}
if (IsNotAllowed(proto->ItemId))
return false;
@@ -568,7 +577,7 @@ void Transmogrification::LoadConfig(bool reload)
{
#ifdef PRESETS
EnableSetInfo = sConfigMgr->GetBoolDefault("Transmogrification.EnableSetInfo", true);
SetNpcText = uint32(sConfigMgr->GetIntDefault("Transmogrification.SetNpcText", 500001));
SetNpcText = uint32(sConfigMgr->GetIntDefault("Transmogrification.SetNpcText", 601084));
EnableSets = sConfigMgr->GetBoolDefault("Transmogrification.EnableSets", true);
MaxSets = (uint8)sConfigMgr->GetIntDefault("Transmogrification.MaxSets", 10);
@@ -595,7 +604,7 @@ void Transmogrification::LoadConfig(bool reload)
#endif
EnableTransmogInfo = sConfigMgr->GetBoolDefault("Transmogrification.EnableTransmogInfo", true);
TransmogNpcText = uint32(sConfigMgr->GetIntDefault("Transmogrification.TransmogNpcText", 500000));
TransmogNpcText = uint32(sConfigMgr->GetIntDefault("Transmogrification.TransmogNpcText", 601083));
std::istringstream issAllowed(sConfigMgr->GetStringDefault("Transmogrification.Allowed", ""));
std::istringstream issNotAllowed(sConfigMgr->GetStringDefault("Transmogrification.NotAllowed", ""));

View File

@@ -1,13 +0,0 @@
if ( MSVC )
add_custom_command(TARGET worldserver
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_TRANSM_DIR}/conf/transmog.conf.dist ${CMAKE_BINARY_DIR}/bin/$(ConfigurationName)/
)
elseif ( MINGW )
add_custom_command(TARGET worldserver
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_TRANSM_DIR}/conf/transmog.conf.dist ${CMAKE_BINARY_DIR}/bin/
)
endif()
install(FILES "${CMAKE_TRANSM_DIR}/conf/transmog.conf.dist" DESTINATION ${CONF_DIR})