Skip to content

Commit

Permalink
fix config (azerothcore#14)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Stoabrogga authored Jan 26, 2019
1 parent 4a34d00 commit 9adab60
Show file tree
Hide file tree
Showing 12 changed files with 190 additions and 39 deletions.
8 changes: 8 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -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 changes: 49 additions & 0 deletions .git_commit_template.txt
Original file line number Diff line number Diff line change
@@ -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 changes: 105 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -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 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
!.gitignore

!*

#
#Generic
#
Expand All @@ -10,7 +8,7 @@
.mailmap
*.orig
*.rej
*~
*.*~
.hg/
*.kdev*
.DS_Store
Expand Down
9 changes: 4 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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")
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 4 additions & 4 deletions conf/transmog.conf.dist
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -30,7 +30,7 @@
# Default: ""

Transmogrification.EnableTransmogInfo = 1
Transmogrification.TransmogNpcText = 500000
Transmogrification.TransmogNpcText = 601083

Transmogrification.Allowed = ""
Transmogrification.NotAllowed = ""
Expand Down Expand Up @@ -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)
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion data/sql/db-world/trasm_world_texts.sql
Original file line number Diff line number Diff line change
@@ -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.'),
Expand Down
4 changes: 4 additions & 0 deletions setup_git_commit_template.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash

## Set a local git commit template
git config --local commit.template ".git_commit_template.txt" ;
8 changes: 0 additions & 8 deletions src/CMakeLists.txt

This file was deleted.

17 changes: 13 additions & 4 deletions src/Transmogrification.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand All @@ -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", ""));
Expand Down
13 changes: 0 additions & 13 deletions src/cmake/after_ws.cmake

This file was deleted.

0 comments on commit 9adab60

Please sign in to comment.