Merge git://github.com/TrinityCore/TrinityCore into mmaps
This commit is contained in:
@@ -1727,20 +1727,6 @@ CREATE TABLE `guild_member` (
|
|||||||
`rank` tinyint(3) unsigned NOT NULL,
|
`rank` tinyint(3) unsigned NOT NULL,
|
||||||
`pnote` varchar(31) NOT NULL DEFAULT '',
|
`pnote` varchar(31) NOT NULL DEFAULT '',
|
||||||
`offnote` varchar(31) NOT NULL DEFAULT '',
|
`offnote` varchar(31) NOT NULL DEFAULT '',
|
||||||
`BankResetTimeMoney` int(10) unsigned NOT NULL DEFAULT '0',
|
|
||||||
`BankRemMoney` int(10) unsigned NOT NULL DEFAULT '0',
|
|
||||||
`BankResetTimeTab0` int(10) unsigned NOT NULL DEFAULT '0',
|
|
||||||
`BankRemSlotsTab0` int(10) unsigned NOT NULL DEFAULT '0',
|
|
||||||
`BankResetTimeTab1` int(10) unsigned NOT NULL DEFAULT '0',
|
|
||||||
`BankRemSlotsTab1` int(10) unsigned NOT NULL DEFAULT '0',
|
|
||||||
`BankResetTimeTab2` int(10) unsigned NOT NULL DEFAULT '0',
|
|
||||||
`BankRemSlotsTab2` int(10) unsigned NOT NULL DEFAULT '0',
|
|
||||||
`BankResetTimeTab3` int(10) unsigned NOT NULL DEFAULT '0',
|
|
||||||
`BankRemSlotsTab3` int(10) unsigned NOT NULL DEFAULT '0',
|
|
||||||
`BankResetTimeTab4` int(10) unsigned NOT NULL DEFAULT '0',
|
|
||||||
`BankRemSlotsTab4` int(10) unsigned NOT NULL DEFAULT '0',
|
|
||||||
`BankResetTimeTab5` int(10) unsigned NOT NULL DEFAULT '0',
|
|
||||||
`BankRemSlotsTab5` int(10) unsigned NOT NULL DEFAULT '0',
|
|
||||||
UNIQUE KEY `guid_key` (`guid`),
|
UNIQUE KEY `guid_key` (`guid`),
|
||||||
KEY `guildid_key` (`guildid`),
|
KEY `guildid_key` (`guildid`),
|
||||||
KEY `guildid_rank_key` (`guildid`,`rank`)
|
KEY `guildid_rank_key` (`guildid`,`rank`)
|
||||||
@@ -1756,6 +1742,35 @@ LOCK TABLES `guild_member` WRITE;
|
|||||||
/*!40000 ALTER TABLE `guild_member` ENABLE KEYS */;
|
/*!40000 ALTER TABLE `guild_member` ENABLE KEYS */;
|
||||||
UNLOCK TABLES;
|
UNLOCK TABLES;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `guild_member_withdraw`
|
||||||
|
--
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS `guild_member_withdraw`;
|
||||||
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
|
/*!40101 SET character_set_client = utf8 */;
|
||||||
|
CREATE TABLE IF NOT EXISTS `guild_member_withdraw` (
|
||||||
|
`guid` int(10) unsigned NOT NULL,
|
||||||
|
`tab0` int(10) unsigned NOT NULL DEFAULT '0',
|
||||||
|
`tab1` int(10) unsigned NOT NULL DEFAULT '0',
|
||||||
|
`tab2` int(10) unsigned NOT NULL DEFAULT '0',
|
||||||
|
`tab3` int(10) unsigned NOT NULL DEFAULT '0',
|
||||||
|
`tab4` int(10) unsigned NOT NULL DEFAULT '0',
|
||||||
|
`tab5` int(10) unsigned NOT NULL DEFAULT '0',
|
||||||
|
`money` int(10) unsigned NOT NULL DEFAULT '0',
|
||||||
|
PRIMARY KEY (`guid`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Guild Member Daily Withdraws';
|
||||||
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Dumping data for table `guild_member_withdraw`
|
||||||
|
--
|
||||||
|
|
||||||
|
LOCK TABLES `guild_member_withdraw` WRITE;
|
||||||
|
/*!40000 ALTER TABLE `guild_member_withdraw` DISABLE KEYS */;
|
||||||
|
/*!40000 ALTER TABLE `guild_member_withdraw` ENABLE KEYS */;
|
||||||
|
UNLOCK TABLES;
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Table structure for table `guild_rank`
|
-- Table structure for table `guild_rank`
|
||||||
--
|
--
|
||||||
|
|||||||
@@ -27,4 +27,3 @@ ALTER TABLE `guild_member` DROP COLUMN `BankResetTimeTab5`;
|
|||||||
|
|
||||||
DELETE FROM `worldstates` WHERE `entry`=20006;
|
DELETE FROM `worldstates` WHERE `entry`=20006;
|
||||||
INSERT INTO `worldstates` (`entry`,`value`,`comment`) VALUES (20006,0, 'Guild daily reset');
|
INSERT INTO `worldstates` (`entry`,`value`,`comment`) VALUES (20006,0, 'Guild daily reset');
|
||||||
|
|
||||||
|
|||||||
@@ -223,10 +223,9 @@ void Guild::RankInfo::SaveToDB(SQLTransaction& trans) const
|
|||||||
CharacterDatabase.ExecuteOrAppend(trans, stmt);
|
CharacterDatabase.ExecuteOrAppend(trans, stmt);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Guild::RankInfo::CreateMissingTabsIfNeeded(uint8 ranks, SQLTransaction& trans)
|
void Guild::RankInfo::CreateMissingTabsIfNeeded(uint8 tabs, SQLTransaction& trans, bool logOnCreate /* = false */)
|
||||||
{
|
{
|
||||||
bool ret = false;
|
for (uint8 i = 0; i < tabs; ++i)
|
||||||
for (uint8 i = 0; i < ranks; ++i)
|
|
||||||
{
|
{
|
||||||
GuildBankRightsAndSlots& rightsAndSlots = m_bankTabRightsAndSlots[i];
|
GuildBankRightsAndSlots& rightsAndSlots = m_bankTabRightsAndSlots[i];
|
||||||
if (rightsAndSlots.GetTabId() == i)
|
if (rightsAndSlots.GetTabId() == i)
|
||||||
@@ -236,7 +235,9 @@ bool Guild::RankInfo::CreateMissingTabsIfNeeded(uint8 ranks, SQLTransaction& tra
|
|||||||
if (m_rankId == GR_GUILDMASTER)
|
if (m_rankId == GR_GUILDMASTER)
|
||||||
rightsAndSlots.SetGuildMasterValues();
|
rightsAndSlots.SetGuildMasterValues();
|
||||||
|
|
||||||
ret = true;
|
if (logOnCreate)
|
||||||
|
sLog->outError(LOG_FILTER_GUILD, "Guild %u has broken Tab %u for rank %u. Created default tab.", m_guildId, i, m_rankId);
|
||||||
|
|
||||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_GUILD_BANK_RIGHT);
|
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_GUILD_BANK_RIGHT);
|
||||||
stmt->setUInt32(0, m_guildId);
|
stmt->setUInt32(0, m_guildId);
|
||||||
stmt->setUInt8 (1, i);
|
stmt->setUInt8 (1, i);
|
||||||
@@ -245,8 +246,6 @@ bool Guild::RankInfo::CreateMissingTabsIfNeeded(uint8 ranks, SQLTransaction& tra
|
|||||||
stmt->setUInt32(4, rightsAndSlots.GetSlots());
|
stmt->setUInt32(4, rightsAndSlots.GetSlots());
|
||||||
trans->Append(stmt);
|
trans->Append(stmt);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Guild::RankInfo::WritePacket(WorldPacket& data) const
|
void Guild::RankInfo::WritePacket(WorldPacket& data) const
|
||||||
@@ -2018,14 +2017,11 @@ bool Guild::Validate()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||||
if (rankInfo->CreateMissingTabsIfNeeded(_GetPurchasedTabsSize(), trans))
|
rankInfo->CreateMissingTabsIfNeeded(_GetPurchasedTabsSize(), trans, true);
|
||||||
{
|
|
||||||
sLog->outError(LOG_FILTER_GUILD, "Guild %u has broken Tabs for rank id %u, creating default tab...", m_id, rankId);
|
|
||||||
CharacterDatabase.CommitTransaction(trans);
|
CharacterDatabase.CommitTransaction(trans);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (broken_ranks)
|
if (broken_ranks)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -500,7 +500,7 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void SetBankTabSlotsAndRights(GuildBankRightsAndSlots rightsAndSlots, bool saveToDB);
|
void SetBankTabSlotsAndRights(GuildBankRightsAndSlots rightsAndSlots, bool saveToDB);
|
||||||
bool CreateMissingTabsIfNeeded(uint8 ranks, SQLTransaction& trans);
|
void CreateMissingTabsIfNeeded(uint8 ranks, SQLTransaction& trans, bool logOnCreate = false);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
uint32 m_guildId;
|
uint32 m_guildId;
|
||||||
|
|||||||
@@ -232,20 +232,18 @@ public:
|
|||||||
{
|
{
|
||||||
Unit* target = NULL;
|
Unit* target = NULL;
|
||||||
if (PlayerGUID)
|
if (PlayerGUID)
|
||||||
{
|
if (Player* player = Unit::GetPlayer(*me, PlayerGUID))
|
||||||
if (Unit* player = Unit::GetPlayer(*me, PlayerGUID)->ToUnit())
|
if (player->isAlive() && RAND(0, 1))
|
||||||
target = RAND((Unit*)me, player);
|
target = player;
|
||||||
} else
|
|
||||||
|
if (!target)
|
||||||
target = me;
|
target = me;
|
||||||
|
|
||||||
if (target)
|
|
||||||
{
|
|
||||||
summoned->setFaction(168);
|
summoned->setFaction(168);
|
||||||
summoned->AddThreat(target, 32.0f);
|
summoned->AddThreat(target, 32.0f);
|
||||||
summoned->AI()->AttackStart(target);
|
summoned->AI()->AttackStart(target);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void JustDied(Unit* /*killer*/)
|
void JustDied(Unit* /*killer*/)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user