Skip to content

Commit

Permalink
Fixed Transmog module git history (please re-clone this repo)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yehonal committed Apr 9, 2018
1 parent e341965 commit 17d79ad
Show file tree
Hide file tree
Showing 8 changed files with 757 additions and 224 deletions.
42 changes: 42 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
sudo: required
dist: trusty # (14.04)
# xenial (16.04) is not supported yet

language: cpp
compiler:
- clang

git:
depth: 1

before_install:
- sudo apt-get -y install build-essential libtool make cmake cmake-data openssl
- sudo apt-get -y install libssl-dev libmysqlclient-dev libmysql++-dev libreadline6-dev zlib1g-dev libbz2-dev libace-dev
- git config user.email "[email protected]" && git config user.name "Travis CI"
- git tag -a -m "Travis build" init

install:
- cd ..
- git clone --depth=1 --branch=master https://github.com/azerothcore/azerothcore-wotlk.git azerothcore
- mv mod-transmog azerothcore/modules
- cd azerothcore
- git submodule update --init --recursive

- mysql -uroot -e 'create database test_mysql;'
- cd bin
- cmake ../ -DWITH_WARNINGS=1 -DWITH_COREDEBUG=0 -DUSE_COREPCH=1 -DUSE_SCRIPTPCH=1 -DTOOLS=0 -DSCRIPTS=1 -DSERVERS=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=check_install
- cd ..

script:
- $CXX --version
- mysql -uroot < data/sql/create/create_mysql.sql
- cat data/sql/base/db_auth/*.sql | mysql -uacore -pacore auth
- cat data/sql/base/db_characters/*.sql | mysql -uacore -pacore characters
- cat data/sql/base/db_world/*.sql | mysql -uacore -pacore world
- cat data/sql/updates/db_auth/*.sql | mysql -uacore -pacore auth
- cat data/sql/updates/db_characters/*.sql | mysql -uacore -pacore characters
- cat data/sql/updates/db_world/*.sql | mysql -uacore -pacore world
- mysql -uroot < data/sql/create/drop_mysql.sql
- cd bin
- make -j 8 -k && make install
- cd check_install/bin
854 changes: 646 additions & 208 deletions LICENSE

Large diffs are not rendered by default.

41 changes: 41 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Transmog Module

- Latest Transmog build status with azerothcore: [![Build Status](https://travis-ci.org/azerothcore/mod-transmog.svg?branch=master)](https://travis-ci.org/azerothcore/mod-transmog)

This is a module for [AzerothCore](http://www.azerothcore.org) that adds transmog feature, it's based on [Rochet2 Transmog Script](http://rochet2.github.io/Transmogrification.html)

## Requirements

Transmogrification module currently requires:

AzerothCore v1.0.2+

## How to install

###1) Simply place the module under the `modules` folder of your AzerothCore source folder.

You can do clone it via git under the azerothcore/modules directory:

`cd path/to/azerothcore/modules`

`git clone https://github.com/azerothcore/mod-transmog.git`

or you can manually [download the module](https://github.com/azerothcore/mod-transmog/archive/master.zip), unzip the Transmog folder and place it under the `azerothcore/modules` directory.

###2) Re-run cmake and launch a clean build of AzerothCore

**That's it.**

### (Optional) Edit module configuration

If you need to change the module configuration, go to your server configuration folder (e.g. **etc**), copy `transmog.conf.dist` to `transmog.conf` and edit it as you prefer.


## License

This module is released under the [GNU AGPL license](https://github.com/azerothcore/mod-transmog/blob/master/LICENSE).





2 changes: 1 addition & 1 deletion conf/conf.sh.dist
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

#
# CUSTOM
Expand Down
Binary file added icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion include.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

TRANSM_PATH_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )/" && pwd )"

Expand Down
9 changes: 2 additions & 7 deletions src/Transmogrification.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,15 +272,15 @@ void Transmogrification::UpdateItem(Player* player, Item* item) const
}
}

void Transmogrification::DeleteFakeEntry(Player* player, uint8 slot, Item* itemTransmogrified, SQLTransaction* trans)
void Transmogrification::DeleteFakeEntry(Player* player, uint8 /*slot*/, Item* itemTransmogrified, SQLTransaction* trans)
{
//if (!GetFakeEntry(item))
// return false;
DeleteFakeFromDB(itemTransmogrified->GetGUID(), trans);
UpdateItem(player, itemTransmogrified);
}

void Transmogrification::SetFakeEntry(Player* player, uint32 newEntry, uint8 slot, Item* itemTransmogrified)
void Transmogrification::SetFakeEntry(Player* player, uint32 newEntry, uint8 /*slot*/, Item* itemTransmogrified)
{
uint64 itemGUID = itemTransmogrified->GetGUID();
entryMap[player->GetGUID()][itemGUID] = newEntry;
Expand Down Expand Up @@ -376,11 +376,6 @@ TransmogTrinityStrings Transmogrification::Transmogrify(Player* player, uint64 i
itemTransmogrifier->ClearSoulboundTradeable(player);
}

// trusting the client, if it got here it has to have enough money
// ... unless client was modified
if (cost) // 0 cost if reverting look
player->ModifyMoney(-1 * cost, false);

return LANG_ERR_TRANSMOG_OK;
}

Expand Down
31 changes: 24 additions & 7 deletions src/transmog_scripts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class npc_transmogrifier : public CreatureScript
}
if (removed)
{
session->SendAreaTriggerMessage(GTS(LANG_ERR_UNTRANSMOG_OK));
session->SendAreaTriggerMessage("%s", GTS(LANG_ERR_UNTRANSMOG_OK));
CharacterDatabase.CommitTransaction(trans);
}
else
Expand All @@ -96,7 +96,7 @@ class npc_transmogrifier : public CreatureScript
if (sT->GetFakeEntry(newItem->GetGUID()))
{
sT->DeleteFakeEntry(player, action, newItem);
session->SendAreaTriggerMessage(GTS(LANG_ERR_UNTRANSMOG_OK));
session->SendAreaTriggerMessage("%s", GTS(LANG_ERR_UNTRANSMOG_OK));
}
else
session->SendNotification(LANG_ERR_UNTRANSMOG_NO_TRANSMOGS);
Expand Down Expand Up @@ -222,7 +222,7 @@ class npc_transmogrifier : public CreatureScript
// sender = slot, action = display
TransmogTrinityStrings res = sT->Transmogrify(player, MAKE_NEW_GUID(action, 0, HIGHGUID_ITEM), sender);
if (res == LANG_ERR_TRANSMOG_OK)
session->SendAreaTriggerMessage(GTS(LANG_ERR_TRANSMOG_OK));
session->SendAreaTriggerMessage("%s",GTS(LANG_ERR_TRANSMOG_OK));
else
session->SendNotification(res);
// OnGossipSelect(player, creature, EQUIPMENT_SLOT_END, sender);
Expand Down Expand Up @@ -293,7 +293,7 @@ class npc_transmogrifier : public CreatureScript
sT->presetByName[player->GetGUID()][presetID] = name; // Make sure code doesnt mess up SQL!
CharacterDatabase.PExecute("REPLACE INTO `custom_transmogrification_sets` (`Owner`, `PresetID`, `SetName`, `SetData`) VALUES (%u, %u, \"%s\", \"%s\")", player->GetGUIDLow(), uint32(presetID), name.c_str(), ss.str().c_str());
if (cost)
player->ModifyMoney(cost);
player->ModifyMoney(-cost);
break;
}
}
Expand Down Expand Up @@ -374,6 +374,10 @@ class PS_Transmogrification : public PlayerScript
if (uint32 entry = sT->GetFakeEntry(item->GetGUID()))
player->SetUInt32Value(PLAYER_VISIBLE_ITEM_1_ENTRYID + (slot * 2), entry);
}

void OnAfterMoveItemFromInventory(Player* player, Item* it, uint8 /*bag*/, uint8 /*slot*/, bool /*update*/) {
sT->DeleteFakeFromDB(it->GetGUIDLow());
}

void OnLogin(Player* player)
{
Expand Down Expand Up @@ -413,7 +417,7 @@ class PS_Transmogrification : public PlayerScript

void OnLogout(Player* player)
{
uint32 pGUID = player->GetGUID();
uint64 pGUID = player->GetGUID();
for (Transmogrification::transmogData::const_iterator it = sT->entryMap[pGUID].begin(); it != sT->entryMap[pGUID].end(); ++it)
sT->dataMap.erase(it->first);
sT->entryMap.erase(pGUID);
Expand All @@ -430,13 +434,13 @@ class WS_Transmogrification : public WorldScript
public:
WS_Transmogrification() : WorldScript("WS_Transmogrification") { }

void OnAfterConfigLoad(bool reload)
void OnAfterConfigLoad(bool reload) override
{
if (reload)
sT->LoadConfig(reload);
}

void OnStartup()
void OnStartup() override
{
sT->LoadConfig(false);
//sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Deleting non-existing transmogrification entries...");
Expand All @@ -448,6 +452,19 @@ class WS_Transmogrification : public WorldScript
CharacterDatabase.Execute("DELETE FROM `custom_transmogrification_sets` WHERE NOT EXISTS(SELECT 1 FROM characters WHERE characters.guid = custom_transmogrification_sets.Owner)");
#endif
}

void OnBeforeConfigLoad(bool reload) override
{
if (!reload) {
std::string conf_path = _CONF_DIR;
std::string cfg_file = conf_path + "/transmog.conf";
std::string cfg_def_file = cfg_file +".dist";

sConfigMgr->LoadMore(cfg_def_file.c_str());

sConfigMgr->LoadMore(cfg_file.c_str());
}
}
};

class global_transmog_script : public GlobalScript {
Expand Down

3 comments on commit 17d79ad

@BarbzYHOOL
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wtf happened, I still have the old history if you want

@Yehonal
Copy link
Member Author

@Yehonal Yehonal commented on 17d79ad Apr 9, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be better if you reclone it please

@BarbzYHOOL
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but why? and how to warn people?

Please sign in to comment.