Skip to content
Merged
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
sudo: required
dist: xenial # (16.04)
# bionic (18.04) is not yet available in travis
dist: bionic # (18.04)

language: cpp

Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ AC_ADD_SCRIPT("${CMAKE_CURRENT_LIST_DIR}/src/Solocraft.cpp")

AC_ADD_SCRIPT_LOADER("Solocraft" "${CMAKE_CURRENT_LIST_DIR}/src/loader.h")

CU_ADD_HOOK(AFTER_WORLDSERVER_CMAKE "${CMAKE_CURRENT_LIST_DIR}/src/cmake/after_ws_install.cmake")
AC_ADD_CONFIG_FILE("${CMAKE_CURRENT_LIST_DIR}/conf/Solocraft.conf.dist")
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# ![logo](https://raw.githubusercontent.com/azerothcore/azerothcore.github.io/master/images/logo-github.png) AzerothCore
## mod-solocraft
### This is a module for [AzerothCore](http://www.azerothcore.org)
# mod-solocraft
- Latest build status with azerothcore: [![Build Status](https://travis-ci.org/azerothcore/mod-solocraft.svg?branch=master)](https://travis-ci.org/azerothcore/mod-solocraft)


Expand Down
70 changes: 11 additions & 59 deletions src/Solocraft.cpp
Original file line number Diff line number Diff line change
@@ -1,47 +1,4 @@
/*
# SoloCraft #
### Description ###
------------------------------------------------------------------------------------------------------------------
- Adjusts player stats for raids based on the # of players in the group
- Config: Difficulty settings for each instance type
## To-Do ###
------------------------------------------------------------------------------------------------------------------
- Verify player pets are buffed accordingly
- Dispel target regeneration
- (This is not needed in 3.3.5a) Provide unlimited http://www.wowhead.com/item=17333/aqual-quintessence
## Data ###
------------------------------------------------------------------------------------------------------------------
- Type: Server/Player
- Script: Solocraft
- Config: Yes
- SQL: No
### Version ###
------------------------------------------------------------------------------------------------------------------
- v2019.04.12 - Commented out unnecessary code so now the values from config file are parsed correctly (Lines 139-142)
- v2017.09.04 - Add config options for difficulty levels
- v2017.09.05 - Release - Update strings, Add module announce
### Credits ###
------------------------------------------------------------------------------------------------------------------
#### A module for AzerothCore by StygianTheBest ([stygianthebest.github.io](http://stygianthebest.github.io)) ####
###### Additional Credits include:
- [Blizzard Entertainment](http://blizzard.com)
- [TrinityCore](https://github.com/TrinityCore/TrinityCore/blob/3.3.5/THANKS)
- [SunwellCore](http://www.azerothcore.org/pages/sunwell.pl/)
- [AzerothCore](https://github.com/AzerothCore/azerothcore-wotlk/graphs/contributors)
- [AzerothCore Discord](https://discord.gg/gkt4y2x)
- [EMUDevs](https://youtube.com/user/EmuDevs)
- [AC-Web](http://ac-web.org/)
- [ModCraft.io](http://modcraft.io/)
- [OwnedCore](http://ownedcore.com/)
- [OregonCore](https://wiki.oregon-core.net/)
- [Wowhead.com](http://wowhead.com)
- [AoWoW](https://wotlk.evowow.com/)
### License ###
------------------------------------------------------------------------------------------------------------------
- This code and content is released under the [GNU AGPL v3](https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3).
*/

#include <map>
#include <map>
#include "Config.h"
#include "ScriptMgr.h"
#include "Unit.h"
Expand All @@ -50,6 +7,7 @@
#include "Map.h"
#include "Group.h"
#include "InstanceScript.h"
#include "Chat.h"

bool SoloCraftEnable = 1;
bool SoloCraftAnnounceModule = 1;
Expand All @@ -69,10 +27,6 @@ class SolocraftConfig : public WorldScript
std::string conf_path = _CONF_DIR;
std::string cfg_file = conf_path + "/Solocraft.conf";

#ifdef WIN32
cfg_file = "Solocraft.conf";
#endif

std::string cfg_def_file = cfg_file + ".dist";
sConfigMgr->LoadMore(cfg_def_file.c_str());
sConfigMgr->LoadMore(cfg_file.c_str());
Expand Down Expand Up @@ -117,10 +71,8 @@ class solocraft_player_instance_handler : public PlayerScript {

public:

solocraft_player_instance_handler() : PlayerScript("solocraft_player_instance_handler") {
sLog->outString("scripts.solocraft.player.instance", "[Solocraft] solocraft_player_instance_handler Loaded");
}

solocraft_player_instance_handler() : PlayerScript("solocraft_player_instance_handler") {}

void OnMapChanged(Player *player) override {
if (sConfigMgr->GetBoolDefault("Solocraft.Enable", true))
{
Expand All @@ -143,7 +95,7 @@ class solocraft_player_instance_handler : public PlayerScript {
*/

// Set the instance difficulty
int CalculateDifficulty(Map *map, Player *player) {
int CalculateDifficulty(Map* map, Player* /*player*/) {
int difficulty = 1;
if (map) {
if (map->Is25ManRaid()) {
Expand All @@ -163,7 +115,7 @@ class solocraft_player_instance_handler : public PlayerScript {
}

// Get the groups size
int GetNumInGroup(Player *player) {
int GetNumInGroup(Player* player) {
int numInGroup = 1;
Group *group = player->GetGroup();
if (group) {
Expand All @@ -174,7 +126,7 @@ class solocraft_player_instance_handler : public PlayerScript {
}

// Apply the player buffs
void ApplyBuffs(Player *player, Map *map, int difficulty, int numInGroup)
void ApplyBuffs(Player* player, Map* map, int difficulty, int /*numInGroup*/)
{
ClearBuffs(player, map);

Expand All @@ -185,8 +137,8 @@ class solocraft_player_instance_handler : public PlayerScript {

// Announce to player
std::ostringstream ss;
ss << "|cffFF0000[SoloCraft] |cffFF8000" << player->GetName() << " entered %s - # of Players: %d - Difficulty Offset: %d.";
ChatHandler(player->GetSession()).PSendSysMessage(ss.str().c_str(), map->GetMapName(), numInGroup, difficulty);
ss << "|cffFF0000[SoloCraft] |cffFF8000" << player->GetName() << " entered %s - Difficulty Offset: %d.";
ChatHandler(player->GetSession()).PSendSysMessage(ss.str().c_str(), map->GetMapName(), difficulty);

// Adjust player stats
_unitDifficulty[player->GetGUID()] = difficulty;
Expand All @@ -206,7 +158,7 @@ class solocraft_player_instance_handler : public PlayerScript {
}
}

void ClearBuffs(Player *player, Map *map)
void ClearBuffs(Player* player, Map* map)
{
std::map<uint32, int>::iterator unitDifficultyIterator = _unitDifficulty.find(player->GetGUID());
if (unitDifficultyIterator != _unitDifficulty.end())
Expand All @@ -233,4 +185,4 @@ void AddSolocraftScripts()
new SolocraftConfig();
new SolocraftAnnounce();
new solocraft_player_instance_handler();
}
}
15 changes: 0 additions & 15 deletions src/cmake/after_ws_install.cmake

This file was deleted.