From 88ea67add0c0bfc8a457596e5239c2e214e4e485 Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Tue, 30 Sep 2014 18:55:51 +0200 Subject: Core/SAI: Addet new error log for SMART_ACTION_CAST kill credit invalid target --- src/server/game/AI/SmartScripts/SmartScriptMgr.cpp | 18 +++++++++++++++++- src/server/scripts/Spells/spell_holiday.cpp | 3 --- 2 files changed, 17 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp index 0217a9c3fcd..c5d138b1f82 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp @@ -749,8 +749,24 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) if (e.action.randomEmote.emote6 && !IsEmoteValid(e, e.action.randomEmote.emote6)) return false; break; - case SMART_ACTION_ADD_AURA: case SMART_ACTION_CAST: + { + if (!IsSpellValid(e, e.action.cast.spell)) + return false; + + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(e.action.cast.spell); + for (uint32 j = 0; j < MAX_SPELL_EFFECTS; ++j) + { + if (spellInfo->Effects[j].IsEffect(SPELL_EFFECT_KILL_CREDIT) || spellInfo->Effects[j].IsEffect(SPELL_EFFECT_KILL_CREDIT2)) + { + if (spellInfo->Effects[j].TargetA.GetTarget() == TARGET_UNIT_CASTER) + TC_LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u Effect: SPELL_EFFECT_KILL_CREDIT: (SpellId: %u targetA: %u - targetB: %u) has invalid target for this Action", + e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.cast.spell, spellInfo->Effects[j].TargetA, spellInfo->Effects[j].TargetB); + } + } + break; + } + case SMART_ACTION_ADD_AURA: case SMART_ACTION_INVOKER_CAST: if (!IsSpellValid(e, e.action.cast.spell)) return false; diff --git a/src/server/scripts/Spells/spell_holiday.cpp b/src/server/scripts/Spells/spell_holiday.cpp index e43249ff8aa..ea7ca528ac9 100644 --- a/src/server/scripts/Spells/spell_holiday.cpp +++ b/src/server/scripts/Spells/spell_holiday.cpp @@ -430,9 +430,6 @@ class spell_winter_veil_px_238_winter_wondervolt : public SpellScriptLoader { OnEffectHitTarget += SpellEffectFn(spell_winter_veil_px_238_winter_wondervolt_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); } - - private: - }; SpellScript* GetSpellScript() const override -- cgit v1.2.3 From 7e2ef67936137f6ccb318391f0a640eb7816e507 Mon Sep 17 00:00:00 2001 From: jackpoz Date: Tue, 30 Sep 2014 20:38:43 +0200 Subject: Core/LootMgr: Fix wrong bit fields padding --- src/server/game/Loot/LootMgr.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Loot/LootMgr.h b/src/server/game/Loot/LootMgr.h index 1f5c0251eec..f404a553632 100644 --- a/src/server/game/Loot/LootMgr.h +++ b/src/server/game/Loot/LootMgr.h @@ -127,11 +127,11 @@ struct LootStoreItem uint32 itemid; // id of the item uint32 reference; // referenced TemplateleId float chance; // chance to drop for both quest and non-quest items, chance to be used for refs - bool needs_quest : 1; // quest drop (quest is required for item to drop) uint16 lootmode; + bool needs_quest : 1; // quest drop (quest is required for item to drop) uint8 groupid : 7; uint8 mincount; // mincount for drop items - uint8 maxcount : 8; // max drop count for the item mincount or Ref multiplicator + uint8 maxcount; // max drop count for the item mincount or Ref multiplicator ConditionList conditions; // additional loot condition // Constructor -- cgit v1.2.3 From 6daba66baf70d45e3b8ce681f588e4e9349d63ab Mon Sep 17 00:00:00 2001 From: jackpoz Date: Tue, 30 Sep 2014 20:58:50 +0200 Subject: Core/LootMgr: Fix GCC warning --- src/server/game/Loot/LootMgr.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Loot/LootMgr.h b/src/server/game/Loot/LootMgr.h index f404a553632..1685996fd03 100644 --- a/src/server/game/Loot/LootMgr.h +++ b/src/server/game/Loot/LootMgr.h @@ -137,8 +137,8 @@ struct LootStoreItem // Constructor // displayid is filled in IsValid() which must be called after LootStoreItem(uint32 _itemid, uint32 _reference, float _chance, bool _needs_quest, uint16 _lootmode, uint8 _groupid, int32 _mincount, uint8 _maxcount) - : itemid(_itemid), reference(_reference), chance(_chance), needs_quest(_needs_quest), - lootmode(_lootmode), groupid(_groupid), mincount(_mincount), maxcount(_maxcount) + : itemid(_itemid), reference(_reference), chance(_chance), lootmode(_lootmode), + needs_quest(_needs_quest), groupid(_groupid), mincount(_mincount), maxcount(_maxcount) { } bool Roll(bool rate) const; // Checks if the entry takes it's chance (at loot generation) -- cgit v1.2.3 From 5150222f19c40958d364f7f1118f6f211176d114 Mon Sep 17 00:00:00 2001 From: jackpoz Date: Tue, 30 Sep 2014 21:25:58 +0200 Subject: Revert "Core/AuctionHouse: Delete expired auctions at startup." This reverts commit a92038feaf440abe797ee4b0344612b6176e43a8 which caused items of expired auctions not being mailed back to the owner and leaving those items in item_instance table. Please refer to the forum for steps to verify the integrity of your database and remove old unneeded rows in item_instance table. Fixes #12699 --- src/server/game/AuctionHouse/AuctionHouseMgr.cpp | 118 --------------------- src/server/game/AuctionHouse/AuctionHouseMgr.h | 4 - src/server/game/World/World.cpp | 4 - .../Database/Implementation/CharacterDatabase.cpp | 3 - .../Database/Implementation/CharacterDatabase.h | 2 - 5 files changed, 131 deletions(-) (limited to 'src') diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp index 015109e70ee..3c27453fa7e 100644 --- a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp +++ b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp @@ -737,124 +737,6 @@ bool AuctionEntry::LoadFromDB(Field* fields) } return true; } - -void AuctionHouseMgr::DeleteExpiredAuctionsAtStartup() -{ - // Deletes expired auctions. Should be called at server start before loading auctions. - - // DO NOT USE after auctions are already loaded since this deletes from the DB - // and assumes the auctions HAVE NOT been loaded into a list or AuctionEntryMap yet - - uint32 oldMSTime = getMSTime(); - uint32 expirecount = 0; - time_t curTime = sWorld->GetGameTime(); - - // Query the DB to see if there are any expired auctions - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_EXPIRED_AUCTIONS); - stmt->setUInt32(0, (uint32)curTime+60); - PreparedQueryResult expAuctions = CharacterDatabase.Query(stmt); - - if (!expAuctions) - { - TC_LOG_INFO("server.loading", ">> No expired auctions to delete"); - - return; - } - - do - { - Field* fields = expAuctions->Fetch(); - - AuctionEntry* auction = new AuctionEntry(); - - // Can't use LoadFromDB() because it assumes the auction map is loaded - if (!auction->LoadFromFieldList(fields)) - { - // For some reason the record in the DB is broken (possibly corrupt - // faction info). Delete the object and move on. - delete auction; - continue; - } - - SQLTransaction trans = CharacterDatabase.BeginTransaction(); - - if (auction->bidder==0) - { - // Cancel the auction, there was no bidder - sAuctionMgr->SendAuctionExpiredMail(auction, trans); - } - else - { - // Send the item to the winner and money to seller - sAuctionMgr->SendAuctionSuccessfulMail(auction, trans); - sAuctionMgr->SendAuctionWonMail(auction, trans); - } - - // Call the appropriate AuctionHouseObject script - // ** Do we need to do this while core is still loading? ** - sScriptMgr->OnAuctionExpire(GetAuctionsMap(auction->factionTemplateId), auction); - - // Delete the auction from the DB - auction->DeleteFromDB(trans); - CharacterDatabase.CommitTransaction(trans); - - // Release memory - delete auction; - ++expirecount; - - } - while (expAuctions->NextRow()); - - TC_LOG_INFO("server.loading", ">> Deleted %u expired auctions in %u ms", expirecount, GetMSTimeDiffToNow(oldMSTime)); - - -} - -bool AuctionEntry::LoadFromFieldList(Field* fields) -{ - // Loads an AuctionEntry item from a field list. Unlike "LoadFromDB()", this one - // does not require the AuctionEntryMap to have been loaded with items. It simply - // acts as a wrapper to fill out an AuctionEntry struct from a field list - - Id = fields[0].GetUInt32(); - auctioneer = fields[1].GetUInt32(); - itemGUIDLow = fields[2].GetUInt32(); - itemEntry = fields[3].GetUInt32(); - itemCount = fields[4].GetUInt32(); - owner = fields[5].GetUInt32(); - buyout = fields[6].GetUInt32(); - expire_time = fields[7].GetUInt32(); - bidder = fields[8].GetUInt32(); - bid = fields[9].GetUInt32(); - startbid = fields[10].GetUInt32(); - deposit = fields[11].GetUInt32(); - - CreatureData const* auctioneerData = sObjectMgr->GetCreatureData(auctioneer); - if (!auctioneerData) - { - TC_LOG_ERROR("misc", "AuctionEntry::LoadFromFieldList() - Auction %u has not a existing auctioneer (GUID : %u)", Id, auctioneer); - return false; - } - - CreatureTemplate const* auctioneerInfo = sObjectMgr->GetCreatureTemplate(auctioneerData->id); - if (!auctioneerInfo) - { - TC_LOG_ERROR("misc", "AuctionEntry::LoadFromFieldList() - Auction %u has not a existing auctioneer (GUID : %u Entry: %u)", Id, auctioneer, auctioneerData->id); - return false; - } - - factionTemplateId = auctioneerInfo->faction; - auctionHouseEntry = AuctionHouseMgr::GetAuctionHouseEntry(factionTemplateId); - - if (!auctionHouseEntry) - { - TC_LOG_ERROR("misc", "AuctionEntry::LoadFromFieldList() - Auction %u has auctioneer (GUID : %u Entry: %u) with wrong faction %u", Id, auctioneer, auctioneerData->id, factionTemplateId); - return false; - } - - return true; -} - std::string AuctionEntry::BuildAuctionMailSubject(MailAuctionAnswers response) const { std::ostringstream strm; diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.h b/src/server/game/AuctionHouse/AuctionHouseMgr.h index 0ef61be584a..fc70946d6c4 100644 --- a/src/server/game/AuctionHouse/AuctionHouseMgr.h +++ b/src/server/game/AuctionHouse/AuctionHouseMgr.h @@ -87,7 +87,6 @@ struct AuctionEntry void DeleteFromDB(SQLTransaction& trans) const; void SaveToDB(SQLTransaction& trans) const; bool LoadFromDB(Field* fields); - bool LoadFromFieldList(Field* fields); std::string BuildAuctionMailSubject(MailAuctionAnswers response) const; static std::string BuildAuctionMailBody(uint32 lowGuid, uint32 bid, uint32 buyout, uint32 deposit, uint32 cut); @@ -173,9 +172,6 @@ class AuctionHouseMgr public: - // Used primarily at server start to avoid loading a list of expired auctions - void DeleteExpiredAuctionsAtStartup(); - //load first auction items, because of check if item exists, when loading void LoadAuctionItems(); void LoadAuctions(); diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 0462148129a..a197ea7caa8 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1607,10 +1607,6 @@ void World::SetInitialWorldSettings() TC_LOG_INFO("server.loading", "Loading Completed Achievements..."); sAchievementMgr->LoadCompletedAchievements(); - // Delete expired auctions before loading - TC_LOG_INFO("server.loading", "Deleting expired auctions..."); - sAuctionMgr->DeleteExpiredAuctionsAtStartup(); - ///- Load dynamic data tables from the database TC_LOG_INFO("server.loading", "Loading Item Auctions..."); sAuctionMgr->LoadAuctionItems(); diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp index 328a64dc5b3..e5e563071ec 100644 --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -345,9 +345,6 @@ void CharacterDatabaseConnection::DoPrepareStatements() PrepareStatement(CHAR_INS_GM_SUBSURVEY, "INSERT INTO gm_subsurveys (surveyId, subsurveyId, rank, comment) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC); PrepareStatement(CHAR_INS_LAG_REPORT, "INSERT INTO lag_reports (guid, lagType, mapId, posX, posY, posZ, latency, createTime) VALUES (?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); - // For loading and deleting expired auctions at startup - PrepareStatement(CHAR_SEL_EXPIRED_AUCTIONS, "SELECT id, auctioneerguid, itemguid, itemEntry, count, itemowner, buyoutprice, time, buyguid, lastbid, startbid, deposit FROM auctionhouse ah INNER JOIN item_instance ii ON ii.guid = ah.itemguid WHERE ah.time <= ?", CONNECTION_SYNCH); - // LFG Data PrepareStatement(CHAR_INS_LFG_DATA, "INSERT INTO lfg_data (guid, dungeon, state) VALUES (?, ?, ?)", CONNECTION_ASYNC); PrepareStatement(CHAR_DEL_LFG_DATA, "DELETE FROM lfg_data WHERE guid = ?", CONNECTION_ASYNC); diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.h b/src/server/shared/Database/Implementation/CharacterDatabase.h index 19b5fef82eb..9bc11e3f525 100644 --- a/src/server/shared/Database/Implementation/CharacterDatabase.h +++ b/src/server/shared/Database/Implementation/CharacterDatabase.h @@ -304,8 +304,6 @@ enum CharacterDatabaseStatements CHAR_INS_GM_SUBSURVEY, CHAR_INS_LAG_REPORT, - CHAR_SEL_EXPIRED_AUCTIONS, - CHAR_INS_CHARACTER, CHAR_UPD_CHARACTER, -- cgit v1.2.3 From b74ef3f3ca277e7ce1bca7563fb0e9affbaf1a5a Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Tue, 30 Sep 2014 22:30:27 +0200 Subject: Core/Brewfest: Added texts for quest "Bark for the Thunderbrews!" / "Bark for the Barleybrews!" --- src/server/scripts/Spells/spell_holiday.cpp | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/scripts/Spells/spell_holiday.cpp b/src/server/scripts/Spells/spell_holiday.cpp index ea7ca528ac9..126aa561c05 100644 --- a/src/server/scripts/Spells/spell_holiday.cpp +++ b/src/server/scripts/Spells/spell_holiday.cpp @@ -735,18 +735,37 @@ class spell_brewfest_dismount_ram : public SpellScriptLoader enum RamBlub { + // Horde QUEST_BARK_FOR_DROHNS_DISTILLERY = 11407, QUEST_BARK_FOR_TCHALIS_VOODOO_BREWERY = 11408, + // Alliance + QUEST_BARK_BARLEYBREW = 11293, + QUEST_BARK_FOR_THUNDERBREWS = 11294, + + // Bark for Drohn's Distillery! SAY_DROHN_DISTILLERY_1 = 23520, SAY_DROHN_DISTILLERY_2 = 23521, SAY_DROHN_DISTILLERY_3 = 23522, SAY_DROHN_DISTILLERY_4 = 23523, + // Bark for T'chali's Voodoo Brewery! SAY_TCHALIS_VOODOO_1 = 23524, SAY_TCHALIS_VOODOO_2 = 23525, SAY_TCHALIS_VOODOO_3 = 23526, - SAY_TCHALIS_VOODOO_4 = 23527 + SAY_TCHALIS_VOODOO_4 = 23527, + + // Bark for the Barleybrews! + SAY_BARLEYBREW_1 = 23464, + SAY_BARLEYBREW_2 = 23465, + SAY_BARLEYBREW_3 = 23466, + SAY_BARLEYBREW_4 = 23467, + + // Bark for the Thunderbrews! + SAY_THUNDERBREWS_1 = 23467, + SAY_THUNDERBREWS_2 = 23468, + SAY_THUNDERBREWS_3 = 23469, + SAY_THUNDERBREWS_4 = 22942 }; // 43259 Brewfest - Barker Bunny 1 @@ -781,6 +800,14 @@ class spell_brewfest_barker_bunny : public SpellScriptLoader target->GetQuestStatus(QUEST_BARK_FOR_TCHALIS_VOODOO_BREWERY) == QUEST_STATUS_COMPLETE) BroadcastTextId = RAND(SAY_TCHALIS_VOODOO_1, SAY_TCHALIS_VOODOO_2, SAY_TCHALIS_VOODOO_3, SAY_TCHALIS_VOODOO_4); + if (target->GetQuestStatus(QUEST_BARK_BARLEYBREW) == QUEST_STATUS_INCOMPLETE || + target->GetQuestStatus(QUEST_BARK_BARLEYBREW) == QUEST_STATUS_COMPLETE) + BroadcastTextId = RAND(SAY_BARLEYBREW_1, SAY_BARLEYBREW_2, SAY_BARLEYBREW_3, SAY_BARLEYBREW_4); + + if (target->GetQuestStatus(QUEST_BARK_FOR_THUNDERBREWS) == QUEST_STATUS_INCOMPLETE || + target->GetQuestStatus(QUEST_BARK_FOR_THUNDERBREWS) == QUEST_STATUS_COMPLETE) + BroadcastTextId = RAND(SAY_THUNDERBREWS_1, SAY_THUNDERBREWS_2, SAY_THUNDERBREWS_3, SAY_THUNDERBREWS_4); + if (BroadcastTextId) target->Talk(BroadcastTextId, CHAT_MSG_SAY, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), target); } -- cgit v1.2.3