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

8
.editorconfig Normal file
View File

@@ -0,0 +1,8 @@
[*]
charset = utf-8
indent_style = space
indent_size = 4
tab_width = 4
insert_final_newline = true
trim_trailing_whitespace = true
max_line_length = 80

49
.git_commit_template.txt Normal file
View File

@@ -0,0 +1,49 @@
### TITLE
## Type(Scope/Subscope): Commit ultra short explanation
## |---- Write below the examples with a maximum of 50 characters ----|
## Example 1: fix(DB/SAI): Missing spell to NPC Hogger
## Example 2: fix(CORE/Raid): Phase 2 of Ragnaros
## Example 3: feat(CORE/Commands): New GM command to do something
### DESCRIPTION
## Explain why this change is being made, what does it fix etc...
## |---- Write below the examples with a maximum of 72 characters per lines ----|
## Example: Hogger (id: 492) was not charging player when being engaged.
## Provide links to any issue, commit, pull request or other resource
## Example 1: Closes issue #23
## Example 2: Ported from other project's commit (link)
## Example 3: References taken from wowpedia / wowhead / wowwiki / https://wowgaming.altervista.org/aowow/
## =======================================================
## EXTRA INFOS
## =======================================================
## "Type" can be:
## feat (new feature)
## fix (bug fix)
## refactor (refactoring production code)
## style (formatting, missing semi colons, etc; no code change)
## docs (changes to documentation)
## test (adding or refactoring tests; no production code change)
## chore (updating bash scripts, git files etc; no production code change)
## --------------------
## Remember to
## Capitalize the subject line
## Use the imperative mood in the subject line
## Do not end the subject line with a period
## Separate subject from body with a blank line
## Use the body to explain what and why rather than how
## Can use multiple lines with "-" for bullet points in body
## --------------------
## More info here https://www.conventionalcommits.org/en/v1.0.0-beta.2/
## =======================================================
## "Scope" can be:
## CORE (core related, c++)
## DB (database related, sql)
## =======================================================
## "Subscope" is optional and depends on the nature of the commit.
## =======================================================

105
.gitattributes vendored Normal file
View File

@@ -0,0 +1,105 @@
## AUTO-DETECT
## Handle line endings automatically for files detected as
## text and leave all files detected as binary untouched.
## This will handle all files NOT defined below.
* text=auto eol=lf
# Text
*.conf text
*.conf.dist text
*.cmake text
## Scripts
*.sh text
*.fish text
*.lua text
## SQL
*.sql text
## C++
*.c text
*.cc text
*.cxx text
*.cpp text
*.c++ text
*.hpp text
*.h text
*.h++ text
*.hh text
## For documentation
# Documents
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
## DOCUMENTATION
*.markdown text
*.md text
*.mdwn text
*.mdown text
*.mkd text
*.mkdn text
*.mdtxt text
*.mdtext text
*.txt text
AUTHORS text
CHANGELOG text
CHANGES text
CONTRIBUTING text
COPYING text
copyright text
*COPYRIGHT* text
INSTALL text
license text
LICENSE text
NEWS text
readme text
*README* text
TODO text
## GRAPHICS
*.ai binary
*.bmp binary
*.eps binary
*.gif binary
*.ico binary
*.jng binary
*.jp2 binary
*.jpg binary
*.jpeg binary
*.jpx binary
*.jxr binary
*.pdf binary
*.png binary
*.psb binary
*.psd binary
*.svg text
*.svgz binary
*.tif binary
*.tiff binary
*.wbmp binary
*.webp binary
## ARCHIVES
*.7z binary
*.gz binary
*.jar binary
*.rar binary
*.tar binary
*.zip binary
## EXECUTABLES
*.exe binary
*.pyc binary

4
.gitignore vendored
View File

@@ -1,7 +1,5 @@
!.gitignore
!*
#
#Generic
#
@@ -10,7 +8,7 @@
.mailmap
*.orig
*.rej
*~
*.*~
.hg/
*.kdev*
.DS_Store

View File

@@ -1,6 +1,5 @@
CU_SET_PATH("CMAKE_TRANSM_DIR" "${CMAKE_CURRENT_LIST_DIR}")
CU_SET_PATH("CMAKE_TRANSM_SRC_DIR" "${CMAKE_CURRENT_LIST_DIR}/src/")
include("${CMAKE_TRANSM_SRC_DIR}/CMakeLists.txt")
AC_ADD_SCRIPT("${CMAKE_CURRENT_LIST_DIR}/src/transmog_scripts.cpp")
AC_ADD_SCRIPT("${CMAKE_CURRENT_LIST_DIR}/src/Transmogrification.cpp")
AC_ADD_SCRIPT_LOADER("Transmog" "${CMAKE_CURRENT_LIST_DIR}/src/transmog_scripts_loader.h")
AC_ADD_CONFIG_FILE("${CMAKE_CURRENT_LIST_DIR}/conf/transmog.conf.dist")

View File

@@ -14,7 +14,7 @@ please delete the IDs 50000 and 50001 from npc_text before upgrading AzerothCore
```sql
DELETE FROM `npc_text` WHERE `ID` IN (50000,50001);
```
Otherwise there will be conflicts for these IDs. The module will now use IDs 500000 and 500001 as default.
Otherwise there will be conflicts for these IDs. The module will now use IDs 601083 and 601084 as default.
## Requirements

View File

@@ -17,7 +17,7 @@
#
# Transmogrification.TransmogNpcText
# Description: The npc_text entry of the info menu for transmogrification
# Default: 500000
# Default: 601083
#
# Transmogrification.Allowed
# Description: A list of item entries that are allowed for transmogrification (skips quality and CanUseItem check)
@@ -30,7 +30,7 @@
# Default: ""
Transmogrification.EnableTransmogInfo = 1
Transmogrification.TransmogNpcText = 500000
Transmogrification.TransmogNpcText = 601083
Transmogrification.Allowed = ""
Transmogrification.NotAllowed = ""
@@ -183,7 +183,7 @@ Transmogrification.IgnoreReqStats = 0
#
# Transmogrification.SetNpcText
# Description: The npc_text entry of the info menu for the set feature
# Default: 500001
# Default: 601084
#
# Transmogrification.SetCostModifier
# Description: A multiplier for the default gold cost (all costs summed together) (change to 0 for no default cost)
@@ -197,7 +197,7 @@ Transmogrification.EnableSets = 1
Transmogrification.MaxSets = 10
Transmogrification.EnableSetInfo = 1
Transmogrification.SetNpcText = 500001
Transmogrification.SetNpcText = 601084
Transmogrification.SetCostModifier = 3.0
Transmogrification.SetCopperCost = 0

View File

@@ -1,4 +1,4 @@
SET @TEXT_ID := 500000;
SET @TEXT_ID := 601083;
DELETE FROM `npc_text` WHERE `ID` IN (@TEXT_ID,@TEXT_ID+1);
INSERT INTO `npc_text` (`ID`, `text0_0`) VALUES
(@TEXT_ID, 'Transmogrification allows you to change how your items look like without changing the stats of the items.\r\nItems used in transmogrification are no longer refundable, tradeable and are bound to you.\r\nUpdating a menu updates the view and prices.\r\n\r\nNot everything can be transmogrified with eachother.\r\nRestrictions include but are not limited to:\r\nOnly armor and weapons can be transmogrified\r\nGuns, bows and crossbows can be transmogrified with eachother\r\nFishing poles can not be transmogrified\r\nYou must be able to equip both items used in the process.\r\n\r\nTransmogrifications stay on your items as long as you own them.\r\nIf you try to put the item in guild bank or mail it to someone else, the transmogrification is stripped.\r\n\r\nYou can also remove transmogrifications for free at the transmogrifier.'),

4
setup_git_commit_template.sh Executable file
View File

@@ -0,0 +1,4 @@
#!/usr/bin/env bash
## Set a local git commit template
git config --local commit.template ".git_commit_template.txt" ;

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})