Skip to content

Commit

Permalink
Petition: Move guild charter cost to configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Meltie2013 authored and billy1arm committed Mar 20, 2022
1 parent a9806a5 commit 5037a80
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cmake/MangosParams.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
set(MANGOS_EXP "CLASSIC")
set(MANGOS_PKG "Mangos Zero")
set(MANGOS_WORLD_VER 2021010100)
set(MANGOS_WORLD_VER 2022031600)
set(MANGOS_REALM_VER 2021010100)
set(MANGOS_AHBOT_VER 2021010100)
8 changes: 4 additions & 4 deletions src/game/WorldHandlers/PetitionsHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket& recv_data)
return;
}

if (_player->GetMoney() < cost)
if (_player->GetMoney() < sWorld.getConfig(CONFIG_UNIT32_GUILD_PETITION_COST))
{
// player hasn't got enough money
_player->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, pCreature, charterid, 0);
Expand All @@ -133,8 +133,8 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket& recv_data)
return;
}

_player->ModifyMoney(-(int32)cost);
Item* charter = _player->StoreNewItem(dest, charterid, true);
_player->ModifyMoney(-int64(sWorld.getConfig(CONFIG_UNIT32_GUILD_PETITION_COST)));
Item* charter = _player->StoreNewItem(dest, GUILD_CHARTER, true);
if (!charter)
{
return;
Expand Down Expand Up @@ -691,7 +691,7 @@ void WorldSession::SendPetitionShowList(ObjectGuid guid)
data << uint32(1); // index
data << uint32(GUILD_CHARTER); // charter entry
data << uint32(CHARTER_DISPLAY_ID); // charter display id
data << uint32(GUILD_CHARTER_COST); // charter cost
data << uint32(sWorld.getConfig(CONFIG_UNIT32_GUILD_PETITION_COST)); // charter cost
data << uint32(0); // unknown
data << uint32(4); // required signs
}
Expand Down
1 change: 1 addition & 0 deletions src/game/WorldHandlers/World.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -775,6 +775,7 @@ void World::LoadConfigSettings(bool reload)

setConfig(CONFIG_UINT32_INSTANT_LOGOUT, "InstantLogout", SEC_MODERATOR);

setConfig(CONFIG_UNIT32_GUILD_PETITION_COST, "Guild.PetitionCost", 1000);
setConfigMin(CONFIG_UINT32_GUILD_EVENT_LOG_COUNT, "Guild.EventLogRecordsCount", GUILD_EVENTLOG_MAX_RECORDS, GUILD_EVENTLOG_MAX_RECORDS);

setConfig(CONFIG_UINT32_TIMERBAR_FATIGUE_GMLEVEL, "TimerBar.Fatigue.GMLevel", SEC_CONSOLE);
Expand Down
1 change: 1 addition & 0 deletions src/game/WorldHandlers/World.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ enum eConfigUInt32Values
CONFIG_UINT32_BATTLEGROUND_PREMATURE_FINISH_TIMER,
CONFIG_UINT32_BATTLEGROUND_PREMADE_GROUP_WAIT_FOR_MATCH,
CONFIG_UINT32_BATTLEGROUND_QUEUE_ANNOUNCER_JOIN,
CONFIG_UNIT32_GUILD_PETITION_COST,
CONFIG_UINT32_GUILD_EVENT_LOG_COUNT,
CONFIG_UINT32_TIMERBAR_FATIGUE_GMLEVEL,
CONFIG_UINT32_TIMERBAR_FATIGUE_MAX,
Expand Down
5 changes: 5 additions & 0 deletions src/mangosd/mangosd.conf.dist.in
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,10 @@ SD3ErrorLogFile = "scriptdev3-errors.log"
# Default: 0 (not allowed)
# 1 (allowed)
#
# Guild.PetitionCost
# The cost for guild petition charter (in copper)
# Default: 1000 (10 silver)
#
# Guild.EventLogRecordsCount
# Count of guild event log records stored in guild_eventlog table
# Increase to store more guild events in table, minimum is 100
Expand Down Expand Up @@ -823,6 +827,7 @@ Instance.UnloadDelay = 1800000
Quests.LowLevelHideDiff = 4
Quests.HighLevelHideDiff = 7
Quests.IgnoreRaid = 0
Guild.PetitionCost = 1000
Guild.EventLogRecordsCount = 100
TimerBar.Fatigue.GMLevel = 4
TimerBar.Fatigue.Max = 60
Expand Down

0 comments on commit 5037a80

Please sign in to comment.