Core/Guilds: Multiple changes

- Fix Delete Rank
- Fix Rank order after Rank is deleted
- Send correct event after Guild Tab purchase
- Better debug msgs
- Move news to Event Logs (internal struct is like Event Logs and Bank Event Logs). Max news configurable
This commit is contained in:
Spp committed 2012-11-07 23:21:19 +01:00
1 parent 06eff94506
commit 9659f0335f
27 files changed
+606 -474

No files matched your search

+5 -4
View File
@@ -1577,10 +1577,6 @@ void Spell::DoCreateItem(uint32 /*i*/, uint32 itemtype)
// create the new item and store it
Item* pItem = player->StoreNewItem(dest, newitemid, true, Item::GenerateItemRandomPropertyId(newitemid));
if (pProto->Quality > ITEM_QUALITY_EPIC || (pProto->Quality == ITEM_QUALITY_EPIC && pProto->ItemLevel >= MinNewsItemLevel[sWorld->getIntConfig(CONFIG_EXPANSION)]))
if (Guild* guild = sGuildMgr->GetGuildById(player->GetGuildId()))
guild->GetNewsLog().AddNewEvent(GUILD_NEWS_ITEM_CRAFTED, time(NULL), player->GetGUID(), 0, pProto->ItemId);
// was it successful? return error if not
if (!pItem)
{
@@ -1595,6 +1591,11 @@ void Spell::DoCreateItem(uint32 /*i*/, uint32 itemtype)
// send info to the client
player->SendNewItem(pItem, num_to_add, true, bgType == 0);
if (pProto->Quality > ITEM_QUALITY_EPIC || (pProto->Quality == ITEM_QUALITY_EPIC && pProto->ItemLevel >= MinNewsItemLevel[sWorld->getIntConfig(CONFIG_EXPANSION)]))
if (Guild* guild = player->GetGuild())
guild->AddGuildNews(GUILD_NEWS_ITEM_CRAFTED, player->GetGUID(), 0, pProto->ItemId);
// we succeeded in creating at least one item, so a levelup is possible
if (bgType == 0)
player->UpdateCraftSkill(m_spellInfo->Id);