mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-14 01:19:08 +00:00
* FIX Random Bot Guilds not initialising random emblem, colors, etc #1636 FIX Random Bot Guilds not initialising random emblem, colors, etc #1636 * Update RandomPlayerbotFactory.cpp * Add sql patch an remove FixEmptyGuildEmblems() function
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
#include "Playerbots.h"
|
||||
#include "RandomPlayerbotFactory.h"
|
||||
#include "ServerFacade.h"
|
||||
#include "SharedDefines.h" // GOLD
|
||||
|
||||
bool BuyPetitionAction::Execute(Event event)
|
||||
{
|
||||
@@ -237,6 +238,15 @@ bool PetitionTurnInAction::Execute(Event event)
|
||||
|
||||
if (bot->GetGuildId())
|
||||
{
|
||||
// Ensure that bot has at least 10g for HandleSetEmblem can be managed core side
|
||||
// (EMBLEM_PRICE = 10 * GOLD in core)
|
||||
static constexpr uint32 REQUIRED = 10 * GOLD;
|
||||
uint32 have = bot->GetMoney(); // actual money earned by bot in copper
|
||||
if (have < REQUIRED)
|
||||
{
|
||||
bot->ModifyMoney(int32(REQUIRED - have)); // add only the missing amount to bot to reach 10g
|
||||
}
|
||||
|
||||
Guild* guild = sGuildMgr->GetGuildById(bot->GetGuildId());
|
||||
|
||||
uint32 st, cl, br, bc, bg;
|
||||
@@ -247,7 +257,7 @@ bool PetitionTurnInAction::Execute(Event event)
|
||||
st = urand(0, 180);
|
||||
EmblemInfo emblemInfo(st, cl, br, bc, bg);
|
||||
|
||||
guild->HandleSetEmblem(emblemInfo);
|
||||
guild->HandleSetEmblem(emblemInfo); // official core handling
|
||||
|
||||
// LANG_GUILD_VETERAN -> can invite
|
||||
guild->HandleSetRankInfo(2, GR_RIGHT_GCHATLISTEN | GR_RIGHT_GCHATSPEAK | GR_RIGHT_INVITE);
|
||||
|
||||
Reference in New Issue
Block a user