From 44a317b71fd02cc6ee9ad48bc7d5328ae468db71 Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Fri, 30 Aug 2013 23:58:52 +0200 Subject: DB/Reputation: Move quest_repeatable_rate after quest_monthly_rate --- .../2013_08_31_00_world_reputation_reward_rate.sql | 572 +++++++++++++++++++++ 1 file changed, 572 insertions(+) create mode 100644 sql/updates/world/2013_08_31_00_world_reputation_reward_rate.sql (limited to 'sql/updates') diff --git a/sql/updates/world/2013_08_31_00_world_reputation_reward_rate.sql b/sql/updates/world/2013_08_31_00_world_reputation_reward_rate.sql new file mode 100644 index 00000000000..654bb9fc85f --- /dev/null +++ b/sql/updates/world/2013_08_31_00_world_reputation_reward_rate.sql @@ -0,0 +1,572 @@ +525f381dce8e9f480399832200a1a0736bd9d62d + src/server/game/AI/EventAI/CreatureEventAIMgr.cpp | 4 +- + src/server/game/AI/SmartScripts/SmartScriptMgr.cpp | 2 +- + src/server/game/Entities/Player/Player.cpp | 42 +++++++------- + src/server/game/Globals/ObjectMgr.cpp | 50 ++++++++--------- + src/server/game/Handlers/QuestHandler.cpp | 2 +- + src/server/game/Quests/QuestDef.cpp | 29 +++++----- + src/server/game/Quests/QuestDef.h | 65 +++++++++++++--------- + 7 files changed, 102 insertions(+), 92 deletions(-) + +diff --git a/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp b/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp +index f77499f..c6bfd33 100644 +--- a/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp ++++ b/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp +@@ -507,7 +507,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts() + case ACTION_T_QUEST_EVENT: + if (Quest const* qid = sObjectMgr->GetQuestTemplate(action.quest_event.questId)) + { +- if (!qid->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT)) ++ if (!qid->HasSpecialFlag(QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT)) + TC_LOG_ERROR(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u. SpecialFlags for quest entry %u does not include |2, Action will not have any effect.", i, j+1, action.quest_event.questId); + } + else +@@ -541,7 +541,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts() + case ACTION_T_QUEST_EVENT_ALL: + if (Quest const* qid = sObjectMgr->GetQuestTemplate(action.quest_event_all.questId)) + { +- if (!qid->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT)) ++ if (!qid->HasSpecialFlag(QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT)) + TC_LOG_ERROR(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u. SpecialFlags for quest entry %u does not include |2, Action will not have any effect.", i, j+1, action.quest_event_all.questId); + } + else +diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp +index 2e0fd22..081599c 100644 +--- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp ++++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp +@@ -696,7 +696,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) + case SMART_ACTION_CALL_GROUPEVENTHAPPENS: + if (Quest const* qid = sObjectMgr->GetQuestTemplate(e.action.quest.quest)) + { +- if (!qid->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT)) ++ if (!qid->HasSpecialFlag(QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT)) + { + TC_LOG_ERROR(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u SpecialFlags for Quest entry %u does not include FLAGS_EXPLORATION_OR_EVENT(2), skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.quest.quest); + return false; +diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp +index 9b38117..b1ee724 100644 +--- a/src/server/game/Entities/Player/Player.cpp ++++ b/src/server/game/Entities/Player/Player.cpp +@@ -14921,7 +14921,7 @@ bool Player::CanCompleteQuest(uint32 quest_id) + + if (q_status.Status == QUEST_STATUS_INCOMPLETE) + { +- if (qInfo->HasFlag(QUEST_TRINITY_FLAGS_DELIVER)) ++ if (qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_DELIVER)) + { + for (uint8 i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; i++) + { +@@ -14930,7 +14930,7 @@ bool Player::CanCompleteQuest(uint32 quest_id) + } + } + +- if (qInfo->HasFlag(QUEST_TRINITY_FLAGS_KILL | QUEST_TRINITY_FLAGS_CAST | QUEST_TRINITY_FLAGS_SPEAKTO)) ++ if (qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_KILL | QUEST_SPECIAL_FLAGS_CAST | QUEST_SPECIAL_FLAGS_SPEAKTO)) + { + for (uint8 i = 0; i < QUEST_OBJECTIVES_COUNT; i++) + { +@@ -14942,14 +14942,14 @@ bool Player::CanCompleteQuest(uint32 quest_id) + } + } + +- if (qInfo->HasFlag(QUEST_TRINITY_FLAGS_PLAYER_KILL)) ++ if (qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_PLAYER_KILL)) + if (qInfo->GetPlayersSlain() != 0 && q_status.PlayerCount < qInfo->GetPlayersSlain()) + return false; + +- if (qInfo->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT) && !q_status.Explored) ++ if (qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT) && !q_status.Explored) + return false; + +- if (qInfo->HasFlag(QUEST_TRINITY_FLAGS_TIMED) && q_status.Timer == 0) ++ if (qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_TIMED) && q_status.Timer == 0) + return false; + + if (qInfo->GetRewOrReqMoney() < 0) +@@ -14976,7 +14976,7 @@ bool Player::CanCompleteRepeatableQuest(Quest const* quest) + if (!CanTakeQuest(quest, false)) + return false; + +- if (quest->HasFlag(QUEST_TRINITY_FLAGS_DELIVER)) ++ if (quest->HasSpecialFlag(QUEST_SPECIAL_FLAGS_DELIVER)) + for (uint8 i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; i++) + if (quest->RequiredItemId[i] && quest->RequiredItemCount[i] && !HasItemCount(quest->RequiredItemId[i], quest->RequiredItemCount[i])) + return false; +@@ -15002,7 +15002,7 @@ bool Player::CanRewardQuest(Quest const* quest, bool msg) + return false; + + // prevent receive reward with quest items in bank +- if (quest->HasFlag(QUEST_TRINITY_FLAGS_DELIVER)) ++ if (quest->HasSpecialFlag(QUEST_SPECIAL_FLAGS_DELIVER)) + { + for (uint8 i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; i++) + { +@@ -15079,19 +15079,19 @@ void Player::AddQuest(Quest const* quest, Object* questGiver) + questStatusData.Status = QUEST_STATUS_INCOMPLETE; + questStatusData.Explored = false; + +- if (quest->HasFlag(QUEST_TRINITY_FLAGS_DELIVER)) ++ if (quest->HasSpecialFlag(QUEST_SPECIAL_FLAGS_DELIVER)) + { + for (uint8 i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i) + questStatusData.ItemCount[i] = 0; + } + +- if (quest->HasFlag(QUEST_TRINITY_FLAGS_KILL | QUEST_TRINITY_FLAGS_CAST | QUEST_TRINITY_FLAGS_SPEAKTO)) ++ if (quest->HasSpecialFlag(QUEST_SPECIAL_FLAGS_KILL | QUEST_SPECIAL_FLAGS_CAST | QUEST_SPECIAL_FLAGS_SPEAKTO)) + { + for (uint8 i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) + questStatusData.CreatureOrGOCount[i] = 0; + } + +- if (quest->HasFlag(QUEST_TRINITY_FLAGS_PLAYER_KILL)) ++ if (quest->HasSpecialFlag(QUEST_SPECIAL_FLAGS_PLAYER_KILL)) + questStatusData.PlayerCount = 0; + + GiveQuestSourceItem(quest); +@@ -15106,7 +15106,7 @@ void Player::AddQuest(Quest const* quest, Object* questGiver) + GetReputationMgr().SetVisible(factionEntry); + + uint32 qtime = 0; +- if (quest->HasFlag(QUEST_TRINITY_FLAGS_TIMED)) ++ if (quest->HasSpecialFlag(QUEST_SPECIAL_FLAGS_TIMED)) + { + uint32 limittime = quest->GetLimitTime(); + +@@ -15347,7 +15347,7 @@ void Player::FailQuest(uint32 questId) + SetQuestSlotState(log_slot, QUEST_STATE_FAIL); + } + +- if (quest->HasFlag(QUEST_TRINITY_FLAGS_TIMED)) ++ if (quest->HasSpecialFlag(QUEST_SPECIAL_FLAGS_TIMED)) + { + QuestStatusData& q_status = m_QuestStatus[questId]; + +@@ -15643,7 +15643,7 @@ bool Player::SatisfyQuestConditions(Quest const* qInfo, bool msg) + + bool Player::SatisfyQuestTimed(Quest const* qInfo, bool msg) + { +- if (!m_timedquests.empty() && qInfo->HasFlag(QUEST_TRINITY_FLAGS_TIMED)) ++ if (!m_timedquests.empty() && qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_TIMED)) + { + if (msg) + { +@@ -16003,7 +16003,7 @@ uint16 Player::GetReqKillOrCastCurrentCount(uint32 quest_id, int32 entry) + + void Player::AdjustQuestReqItemCount(Quest const* quest, QuestStatusData& questStatusData) + { +- if (quest->HasFlag(QUEST_TRINITY_FLAGS_DELIVER)) ++ if (quest->HasSpecialFlag(QUEST_SPECIAL_FLAGS_DELIVER)) + { + for (uint8 i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i) + { +@@ -16144,7 +16144,7 @@ void Player::ItemAddedQuestCheck(uint32 entry, uint32 count) + continue; + + Quest const* qInfo = sObjectMgr->GetQuestTemplate(questid); +- if (!qInfo || !qInfo->HasFlag(QUEST_TRINITY_FLAGS_DELIVER)) ++ if (!qInfo || !qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_DELIVER)) + continue; + + for (uint8 j = 0; j < QUEST_ITEM_OBJECTIVES_COUNT; ++j) +@@ -16182,7 +16182,7 @@ void Player::ItemRemovedQuestCheck(uint32 entry, uint32 count) + Quest const* qInfo = sObjectMgr->GetQuestTemplate(questid); + if (!qInfo) + continue; +- if (!qInfo->HasFlag(QUEST_TRINITY_FLAGS_DELIVER)) ++ if (!qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_DELIVER)) + continue; + + for (uint8 j = 0; j < QUEST_ITEM_OBJECTIVES_COUNT; ++j) +@@ -16254,7 +16254,7 @@ void Player::KilledMonsterCredit(uint32 entry, uint64 guid /*= 0*/) + QuestStatusData& q_status = m_QuestStatus[questid]; + if (q_status.Status == QUEST_STATUS_INCOMPLETE && (!GetGroup() || !GetGroup()->isRaidGroup() || qInfo->IsAllowedInRaid(GetMap()->GetDifficulty()))) + { +- if (qInfo->HasFlag(QUEST_TRINITY_FLAGS_KILL) /*&& !qInfo->HasFlag(QUEST_TRINITY_FLAGS_CAST)*/) ++ if (qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_KILL) /*&& !qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_CAST)*/) + { + for (uint8 j = 0; j < QUEST_OBJECTIVES_COUNT; ++j) + { +@@ -16305,7 +16305,7 @@ void Player::KilledPlayerCredit() + QuestStatusData& q_status = m_QuestStatus[questid]; + if (q_status.Status == QUEST_STATUS_INCOMPLETE && (!GetGroup() || !GetGroup()->isRaidGroup() || qInfo->IsAllowedInRaid(GetMap()->GetDifficulty()))) + { +- if (qInfo->HasFlag(QUEST_TRINITY_FLAGS_PLAYER_KILL)) ++ if (qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_PLAYER_KILL)) + { + uint32 reqkill = qInfo->GetPlayersSlain(); + uint16 curkill = q_status.PlayerCount; +@@ -16345,7 +16345,7 @@ void Player::KillCreditGO(uint32 entry, uint64 guid) + + if (q_status.Status == QUEST_STATUS_INCOMPLETE) + { +- if (qInfo->HasFlag(QUEST_TRINITY_FLAGS_CAST) /*&& !qInfo->HasFlag(QUEST_TRINITY_FLAGS_KILL)*/) ++ if (qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_CAST) /*&& !qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_KILL)*/) + { + for (uint8 j = 0; j < QUEST_OBJECTIVES_COUNT; ++j) + { +@@ -16399,7 +16399,7 @@ void Player::TalkedToCreature(uint32 entry, uint64 guid) + + if (q_status.Status == QUEST_STATUS_INCOMPLETE) + { +- if (qInfo->HasFlag(QUEST_TRINITY_FLAGS_KILL | QUEST_TRINITY_FLAGS_CAST | QUEST_TRINITY_FLAGS_SPEAKTO)) ++ if (qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_KILL | QUEST_SPECIAL_FLAGS_CAST | QUEST_SPECIAL_FLAGS_SPEAKTO)) + { + for (uint8 j = 0; j < QUEST_OBJECTIVES_COUNT; ++j) + { +@@ -18188,7 +18188,7 @@ void Player::_LoadQuestStatus(PreparedQueryResult result) + + time_t quest_time = time_t(fields[3].GetUInt32()); + +- if (quest->HasFlag(QUEST_TRINITY_FLAGS_TIMED) && !GetQuestRewardStatus(quest_id)) ++ if (quest->HasSpecialFlag(QUEST_SPECIAL_FLAGS_TIMED) && !GetQuestRewardStatus(quest_id)) + { + AddTimedQuest(quest_id); + +diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp +index 804967c..eaf2306 100644 +--- a/src/server/game/Globals/ObjectMgr.cpp ++++ b/src/server/game/Globals/ObjectMgr.cpp +@@ -3765,11 +3765,11 @@ void ObjectMgr::LoadQuests() + if (qinfo->GetQuestMethod() >= 3) + TC_LOG_ERROR(LOG_FILTER_SQL, "Quest %u has `Method` = %u, expected values are 0, 1 or 2.", qinfo->GetQuestId(), qinfo->GetQuestMethod()); + +- if (qinfo->Flags & ~QUEST_TRINITY_FLAGS_DB_ALLOWED) ++ if (qinfo->SpecialFlags & ~QUEST_SPECIAL_FLAGS_DB_ALLOWED) + { + TC_LOG_ERROR(LOG_FILTER_SQL, "Quest %u has `SpecialFlags` = %u > max allowed value. Correct `SpecialFlags` to value <= %u", +- qinfo->GetQuestId(), qinfo->Flags >> 20, QUEST_TRINITY_FLAGS_DB_ALLOWED >> 20); +- qinfo->Flags &= QUEST_TRINITY_FLAGS_DB_ALLOWED; ++ qinfo->GetQuestId(), qinfo->SpecialFlags, QUEST_SPECIAL_FLAGS_DB_ALLOWED); ++ qinfo->SpecialFlags &= QUEST_SPECIAL_FLAGS_DB_ALLOWED; + } + + if (qinfo->Flags & QUEST_FLAGS_DAILY && qinfo->Flags & QUEST_FLAGS_WEEKLY) +@@ -3778,30 +3778,30 @@ void ObjectMgr::LoadQuests() + qinfo->Flags &= ~QUEST_FLAGS_DAILY; + } + +- if (qinfo->Flags & QUEST_FLAGS_DAILY) ++ if (!(qinfo->SpecialFlags & QUEST_SPECIAL_FLAGS_REPEATABLE)) + { +- if (!(qinfo->Flags & QUEST_TRINITY_FLAGS_REPEATABLE)) ++ if (!(qinfo->Flags & QUEST_FLAGS_DAILY)) + { + TC_LOG_ERROR(LOG_FILTER_SQL, "Daily Quest %u not marked as repeatable in `SpecialFlags`, added.", qinfo->GetQuestId()); +- qinfo->Flags |= QUEST_TRINITY_FLAGS_REPEATABLE; ++ qinfo->SpecialFlags |= QUEST_SPECIAL_FLAGS_REPEATABLE; + } + } + + if (qinfo->Flags & QUEST_FLAGS_WEEKLY) + { +- if (!(qinfo->Flags & QUEST_TRINITY_FLAGS_REPEATABLE)) ++ if (!(qinfo->SpecialFlags & QUEST_SPECIAL_FLAGS_REPEATABLE)) + { + TC_LOG_ERROR(LOG_FILTER_SQL, "Weekly Quest %u not marked as repeatable in `SpecialFlags`, added.", qinfo->GetQuestId()); +- qinfo->Flags |= QUEST_TRINITY_FLAGS_REPEATABLE; ++ qinfo->SpecialFlags |= QUEST_SPECIAL_FLAGS_REPEATABLE; + } + } + +- if (qinfo->Flags & QUEST_TRINITY_FLAGS_MONTHLY) ++ if (qinfo->SpecialFlags & QUEST_SPECIAL_FLAGS_MONTHLY) + { +- if (!(qinfo->Flags & QUEST_TRINITY_FLAGS_REPEATABLE)) ++ if (!(qinfo->SpecialFlags & QUEST_SPECIAL_FLAGS_REPEATABLE)) + { + TC_LOG_ERROR(LOG_FILTER_SQL, "Monthly quest %u not marked as repeatable in `SpecialFlags`, added.", qinfo->GetQuestId()); +- qinfo->Flags |= QUEST_TRINITY_FLAGS_REPEATABLE; ++ qinfo->SpecialFlags |= QUEST_SPECIAL_FLAGS_REPEATABLE; + } + } + +@@ -4019,7 +4019,7 @@ void ObjectMgr::LoadQuests() + // no changes, quest can't be done for this requirement + } + +- qinfo->SetFlag(QUEST_TRINITY_FLAGS_DELIVER); ++ qinfo->SetSpecialFlag(QUEST_SPECIAL_FLAGS_DELIVER); + + if (!sObjectMgr->GetItemTemplate(id)) + { +@@ -4080,7 +4080,7 @@ void ObjectMgr::LoadQuests() + { + // In fact SpeakTo and Kill are quite same: either you can speak to mob:SpeakTo or you can't:Kill/Cast + +- qinfo->SetFlag(QUEST_TRINITY_FLAGS_KILL | QUEST_TRINITY_FLAGS_CAST | QUEST_TRINITY_FLAGS_SPEAKTO); ++ qinfo->SetSpecialFlag(QUEST_SPECIAL_FLAGS_KILL | QUEST_SPECIAL_FLAGS_CAST | QUEST_SPECIAL_FLAGS_SPEAKTO); + + if (!qinfo->RequiredNpcOrGoCount[j]) + { +@@ -4290,12 +4290,12 @@ void ObjectMgr::LoadQuests() + if (qinfo->ExclusiveGroup) + mExclusiveQuestGroups.insert(std::pair(qinfo->ExclusiveGroup, qinfo->GetQuestId())); + if (qinfo->LimitTime) +- qinfo->SetFlag(QUEST_TRINITY_FLAGS_TIMED); ++ qinfo->SetSpecialFlag(QUEST_SPECIAL_FLAGS_TIMED); + if (qinfo->RequiredPlayerKills) +- qinfo->SetFlag(QUEST_TRINITY_FLAGS_PLAYER_KILL); ++ qinfo->SetSpecialFlag(QUEST_SPECIAL_FLAGS_PLAYER_KILL); + } + +- // check QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT for spell with SPELL_EFFECT_QUEST_COMPLETE ++ // check QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT for spell with SPELL_EFFECT_QUEST_COMPLETE + for (uint32 i = 0; i < sSpellMgr->GetSpellInfoStoreSize(); ++i) + { + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(i); +@@ -4315,12 +4315,12 @@ void ObjectMgr::LoadQuests() + if (!quest) + continue; + +- if (!quest->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT)) ++ if (!quest->HasSpecialFlag(QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT)) + { +- TC_LOG_ERROR(LOG_FILTER_SQL, "Spell (id: %u) have SPELL_EFFECT_QUEST_COMPLETE for quest %u, but quest not have flag QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT. Quest flags must be fixed, quest modified to enable objective.", spellInfo->Id, quest_id); ++ TC_LOG_ERROR(LOG_FILTER_SQL, "Spell (id: %u) have SPELL_EFFECT_QUEST_COMPLETE for quest %u, but quest not have flag QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT. Quest flags must be fixed, quest modified to enable objective.", spellInfo->Id, quest_id); + + // this will prevent quest completing without objective +- const_cast(quest)->SetFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT); ++ const_cast(quest)->SetSpecialFlag(QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT); + } + } + } +@@ -4491,13 +4491,13 @@ void ObjectMgr::LoadScripts(ScriptsType type) + continue; + } + +- if (!quest->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT)) ++ if (!quest->HasSpecialFlag(QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT)) + { +- TC_LOG_ERROR(LOG_FILTER_SQL, "Table `%s` has quest (ID: %u) in SCRIPT_COMMAND_QUEST_EXPLORED in `datalong` for script id %u, but quest not have flag QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT in quest flags. Script command or quest flags wrong. Quest modified to require objective.", ++ TC_LOG_ERROR(LOG_FILTER_SQL, "Table `%s` has quest (ID: %u) in SCRIPT_COMMAND_QUEST_EXPLORED in `datalong` for script id %u, but quest not have flag QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT in quest flags. Script command or quest flags wrong. Quest modified to require objective.", + tableName.c_str(), tmp.QuestExplored.QuestID, tmp.id); + + // this will prevent quest completing without objective +- const_cast(quest)->SetFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT); ++ const_cast(quest)->SetSpecialFlag(QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT); + + // continue; - quest objective requirement set and command can be allowed + } +@@ -5390,12 +5390,12 @@ void ObjectMgr::LoadQuestAreaTriggers() + continue; + } + +- if (!quest->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT)) ++ if (!quest->HasSpecialFlag(QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT)) + { +- TC_LOG_ERROR(LOG_FILTER_SQL, "Table `areatrigger_involvedrelation` has record (id: %u) for not quest %u, but quest not have flag QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT. Trigger or quest flags must be fixed, quest modified to require objective.", trigger_ID, quest_ID); ++ TC_LOG_ERROR(LOG_FILTER_SQL, "Table `areatrigger_involvedrelation` has record (id: %u) for not quest %u, but quest not have flag QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT. Trigger or quest flags must be fixed, quest modified to require objective.", trigger_ID, quest_ID); + + // this will prevent quest completing without objective +- const_cast(quest)->SetFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT); ++ const_cast(quest)->SetSpecialFlag(QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT); + + // continue; - quest modified to required objective and trigger can be allowed. + } +diff --git a/src/server/game/Handlers/QuestHandler.cpp b/src/server/game/Handlers/QuestHandler.cpp +index e51d87c..e032c82 100644 +--- a/src/server/game/Handlers/QuestHandler.cpp ++++ b/src/server/game/Handlers/QuestHandler.cpp +@@ -450,7 +450,7 @@ void WorldSession::HandleQuestLogRemoveQuest(WorldPacket& recvData) + + if (Quest const* quest = sObjectMgr->GetQuestTemplate(questId)) + { +- if (quest->HasFlag(QUEST_TRINITY_FLAGS_TIMED)) ++ if (quest->HasSpecialFlag(QUEST_SPECIAL_FLAGS_TIMED)) + _player->RemoveTimedQuest(questId); + + if (quest->HasFlag(QUEST_FLAGS_FLAGS_PVP)) +diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp +index 7345dca..f2e80bd 100644 +--- a/src/server/game/Quests/QuestDef.cpp ++++ b/src/server/game/Quests/QuestDef.cpp +@@ -60,7 +60,7 @@ Quest::Quest(Field* questRecord) + SourceItemIdCount = questRecord[35].GetUInt8(); + SourceSpellid = questRecord[36].GetUInt32(); + Flags = questRecord[37].GetUInt32(); +- uint32 SpecialFlags = questRecord[38].GetUInt8(); ++ SpecialFlags = questRecord[38].GetUInt8(); + RewardTitleId = questRecord[39].GetUInt8(); + RequiredPlayerKills = questRecord[40].GetUInt8(); + RewardTalents = questRecord[41].GetUInt8(); +@@ -139,30 +139,29 @@ Quest::Quest(Field* questRecord) + + //int32 WDBVerified = questRecord[140].GetInt32(); + +- Flags |= SpecialFlags << 20; +- if (Flags & QUEST_TRINITY_FLAGS_AUTO_ACCEPT) ++ if (SpecialFlags & QUEST_SPECIAL_FLAGS_AUTO_ACCEPT) + Flags |= QUEST_FLAGS_AUTO_ACCEPT; + +- m_reqitemscount = 0; +- m_reqCreatureOrGOcount = 0; +- m_rewitemscount = 0; +- m_rewchoiceitemscount = 0; ++ _reqItemsCount = 0; ++ _reqCreatureOrGOcount = 0; ++ _rewItemsCount = 0; ++ _rewChoiceItemsCount = 0; + +- for (int i=0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i) ++ for (int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i) + if (RequiredItemId[i]) +- ++m_reqitemscount; ++ ++_reqItemsCount; + +- for (int i=0; i < QUEST_OBJECTIVES_COUNT; ++i) ++ for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) + if (RequiredNpcOrGo[i]) +- ++m_reqCreatureOrGOcount; ++ ++_reqCreatureOrGOcount; + +- for (int i=0; i < QUEST_REWARDS_COUNT; ++i) ++ for (int i = 0; i < QUEST_REWARDS_COUNT; ++i) + if (RewardItemId[i]) +- ++m_rewitemscount; ++ ++_rewItemsCount; + +- for (int i=0; i < QUEST_REWARD_CHOICES_COUNT; ++i) ++ for (int i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i) + if (RewardChoiceItemId[i]) +- ++m_rewchoiceitemscount; ++ ++_rewChoiceItemsCount; + } + + uint32 Quest::XPValue(Player* player) const +diff --git a/src/server/game/Quests/QuestDef.h b/src/server/game/Quests/QuestDef.h +index b279665..88a4ddf 100644 +--- a/src/server/game/Quests/QuestDef.h ++++ b/src/server/game/Quests/QuestDef.h +@@ -75,7 +75,7 @@ enum QuestShareMessages + QUEST_PARTY_MSG_NOT_IN_PARTY = 10 + }; + +-enum __QuestTradeSkill ++enum QuestTradeSkill + { + QUEST_TRSKILL_NONE = 0, + QUEST_TRSKILL_ALCHEMY = 1, +@@ -106,7 +106,7 @@ enum QuestStatus + MAX_QUEST_STATUS + }; + +-enum __QuestGiverStatus ++enum QuestGiverStatus + { + DIALOG_STATUS_NONE = 0, + DIALOG_STATUS_UNAVAILABLE = 1, +@@ -146,22 +146,28 @@ enum QuestFlags + QUEST_FLAGS_OBJ_TEXT = 0x00040000, // use Objective text as Complete text + QUEST_FLAGS_AUTO_ACCEPT = 0x00080000, // The client recognizes this flag as auto-accept. However, NONE of the current quests (3.3.5a) have this flag. Maybe blizz used to use it, or will use it in the future. + ++ // ... 4.x added flags up to 0x80000000 - all unknown for now ++}; ++ ++enum QuestSpecialFlags ++{ ++ QUEST_SPECIAL_FLAGS_NONE = 0x000, + // Trinity flags for set SpecialFlags in DB if required but used only at server +- QUEST_TRINITY_FLAGS_REPEATABLE = 0x00100000, // Set by 1 in SpecialFlags from DB +- QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT = 0x00200000, // Set by 2 in SpecialFlags from DB (if reequired area explore, spell SPELL_EFFECT_QUEST_COMPLETE casting, table `*_script` command SCRIPT_COMMAND_QUEST_EXPLORED use, set from script) +- QUEST_TRINITY_FLAGS_AUTO_ACCEPT = 0x00400000, // Set by 4 in SpecialFlags in DB if the quest is to be auto-accepted. +- QUEST_TRINITY_FLAGS_DF_QUEST = 0x00800000, // Set by 8 in SpecialFlags in DB if the quest is used by Dungeon Finder. +- QUEST_TRINITY_FLAGS_MONTHLY = 0x01000000, // Set by 16 in SpecialFlags in DB if the quest is reset at the begining of the month +- QUEST_TRINITY_FLAGS_CAST = 0x02000000, // Set by 32 in SpecialFlags in DB if the quest requires RequiredOrNpcGo killcredit but NOT kill (a spell cast) +- +- QUEST_TRINITY_FLAGS_DB_ALLOWED = 0xFFFFF | QUEST_TRINITY_FLAGS_REPEATABLE | QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT | QUEST_TRINITY_FLAGS_AUTO_ACCEPT | QUEST_TRINITY_FLAGS_DF_QUEST | QUEST_TRINITY_FLAGS_MONTHLY | QUEST_TRINITY_FLAGS_CAST, ++ QUEST_SPECIAL_FLAGS_REPEATABLE = 0x001, // Set by 1 in SpecialFlags from DB ++ QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT = 0x002, // Set by 2 in SpecialFlags from DB (if required area explore, spell SPELL_EFFECT_QUEST_COMPLETE casting, table `FECT_QUEST_COMPLETE casting, table `*_script` command SCRIPT_COMMAND_QUEST_EXPLORED use, set from script) ++ QUEST_SPECIAL_FLAGS_AUTO_ACCEPT = 0x004, // Set by 4 in SpecialFlags in DB if the quest is to be auto-accepted. ++ QUEST_SPECIAL_FLAGS_DF_QUEST = 0x008, // Set by 8 in SpecialFlags in DB if the quest is used by Dungeon Finder. ++ QUEST_SPECIAL_FLAGS_MONTHLY = 0x010, // Set by 16 in SpecialFlags in DB if the quest is reset at the begining of the month ++ QUEST_SPECIAL_FLAGS_CAST = 0x020, // Set by 32 in SpecialFlags in DB if the quest requires RequiredOrNpcGo killcredit but NOT kill (a spell cast) ++ // room for more custom flags + +- // Trinity flags for internal use only +- QUEST_TRINITY_FLAGS_DELIVER = 0x04000000, // Internal flag computed only +- QUEST_TRINITY_FLAGS_SPEAKTO = 0x08000000, // Internal flag computed only +- QUEST_TRINITY_FLAGS_KILL = 0x10000000, // Internal flag computed only +- QUEST_TRINITY_FLAGS_TIMED = 0x20000000, // Internal flag computed only +- QUEST_TRINITY_FLAGS_PLAYER_KILL = 0x40000000 // Internal flag computed only ++ QUEST_SPECIAL_FLAGS_DB_ALLOWED = QUEST_SPECIAL_FLAGS_REPEATABLE | QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT | QUEST_SPECIAL_FLAGS_AUTO_ACCEPT | QUEST_SPECIAL_FLAGS_DF_QUEST | QUEST_SPECIAL_FLAGS_MONTHLY | QUEST_SPECIAL_FLAGS_CAST, ++ ++ QUEST_SPECIAL_FLAGS_DELIVER = 0x080, // Internal flag computed only ++ QUEST_SPECIAL_FLAGS_SPEAKTO = 0x100, // Internal flag computed only ++ QUEST_SPECIAL_FLAGS_KILL = 0x200, // Internal flag computed only ++ QUEST_SPECIAL_FLAGS_TIMED = 0x400, // Internal flag computed only ++ QUEST_SPECIAL_FLAGS_PLAYER_KILL = 0x800 // Internal flag computed only + }; + + struct QuestLocale +@@ -191,6 +197,9 @@ class Quest + bool HasFlag(uint32 flag) const { return (Flags & flag) != 0; } + void SetFlag(uint32 flag) { Flags |= flag; } + ++ bool HasSpecialFlag(uint32 flag) const { return (SpecialFlags & flag) != 0; } ++ void SetSpecialFlag(uint32 flag) { SpecialFlags |= flag; } ++ + // table data accessors: + uint32 GetQuestId() const { return Id; } + uint32 GetQuestMethod() const { return Method; } +@@ -246,18 +255,18 @@ class Quest + uint32 GetPointOpt() const { return PointOption; } + uint32 GetIncompleteEmote() const { return EmoteOnIncomplete; } + uint32 GetCompleteEmote() const { return EmoteOnComplete; } +- bool IsRepeatable() const { return Flags & QUEST_TRINITY_FLAGS_REPEATABLE; } ++ bool IsRepeatable() const { return SpecialFlags & QUEST_SPECIAL_FLAGS_REPEATABLE; } + bool IsAutoAccept() const; + bool IsAutoComplete() const; + uint32 GetFlags() const { return Flags; } + bool IsDaily() const { return Flags & QUEST_FLAGS_DAILY; } + bool IsWeekly() const { return Flags & QUEST_FLAGS_WEEKLY; } +- bool IsMonthly() const { return Flags & QUEST_TRINITY_FLAGS_MONTHLY; } ++ bool IsMonthly() const { return SpecialFlags & QUEST_SPECIAL_FLAGS_MONTHLY; } + bool IsSeasonal() const { return (ZoneOrSort == -QUEST_SORT_SEASONAL || ZoneOrSort == -QUEST_SORT_SPECIAL || ZoneOrSort == -QUEST_SORT_LUNAR_FESTIVAL || ZoneOrSort == -QUEST_SORT_MIDSUMMER || ZoneOrSort == -QUEST_SORT_BREWFEST || ZoneOrSort == -QUEST_SORT_LOVE_IS_IN_THE_AIR || ZoneOrSort == -QUEST_SORT_NOBLEGARDEN) && !IsRepeatable(); } + bool IsDailyOrWeekly() const { return Flags & (QUEST_FLAGS_DAILY | QUEST_FLAGS_WEEKLY); } + bool IsRaidQuest(Difficulty difficulty) const; + bool IsAllowedInRaid(Difficulty difficulty) const; +- bool IsDFQuest() const { return Flags & QUEST_TRINITY_FLAGS_DF_QUEST; } ++ bool IsDFQuest() const { return SpecialFlags & QUEST_SPECIAL_FLAGS_DF_QUEST; } + uint32 CalculateHonorGain(uint8 level) const; + + // multiple values +@@ -280,10 +289,10 @@ class Quest + uint32 OfferRewardEmote[QUEST_EMOTE_COUNT]; + uint32 OfferRewardEmoteDelay[QUEST_EMOTE_COUNT]; + +- uint32 GetReqItemsCount() const { return m_reqitemscount; } +- uint32 GetReqCreatureOrGOcount() const { return m_reqCreatureOrGOcount; } +- uint32 GetRewChoiceItemsCount() const { return m_rewchoiceitemscount; } +- uint32 GetRewItemsCount() const { return m_rewitemscount; } ++ uint32 GetReqItemsCount() const { return _reqItemsCount; } ++ uint32 GetReqCreatureOrGOcount() const { return _reqCreatureOrGOcount; } ++ uint32 GetRewChoiceItemsCount() const { return _rewChoiceItemsCount; } ++ uint32 GetRewItemsCount() const { return _rewItemsCount; } + + typedef std::vector PrevQuests; + PrevQuests prevQuests; +@@ -292,10 +301,10 @@ class Quest + + // cached data + private: +- uint32 m_reqitemscount; +- uint32 m_reqCreatureOrGOcount; +- uint32 m_rewchoiceitemscount; +- uint32 m_rewitemscount; ++ uint32 _reqItemsCount; ++ uint32 _reqCreatureOrGOcount; ++ uint32 _rewChoiceItemsCount; ++ uint32 _rewItemsCount; + + // table data + protected: +@@ -354,6 +363,8 @@ class Quest + uint32 PointOption; + uint32 EmoteOnIncomplete; + uint32 EmoteOnComplete; ++ ++ uint32 SpecialFlags; // custom flags, not sniffed/WDB + }; + + struct QuestStatusData -- cgit v1.2.3 From 1501e958767ab0cddc5d501796fdcb63bf98a87c Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Sat, 31 Aug 2013 00:03:35 +0200 Subject: SQL: Fix typo in 44a317b71fd02cc6ee9ad48bc7d5328ae468db71 --- .../2013_08_31_00_world_reputation_reward_rate.sql | 573 +-------------------- 1 file changed, 1 insertion(+), 572 deletions(-) (limited to 'sql/updates') diff --git a/sql/updates/world/2013_08_31_00_world_reputation_reward_rate.sql b/sql/updates/world/2013_08_31_00_world_reputation_reward_rate.sql index 654bb9fc85f..62ac6ae1461 100644 --- a/sql/updates/world/2013_08_31_00_world_reputation_reward_rate.sql +++ b/sql/updates/world/2013_08_31_00_world_reputation_reward_rate.sql @@ -1,572 +1 @@ -525f381dce8e9f480399832200a1a0736bd9d62d - src/server/game/AI/EventAI/CreatureEventAIMgr.cpp | 4 +- - src/server/game/AI/SmartScripts/SmartScriptMgr.cpp | 2 +- - src/server/game/Entities/Player/Player.cpp | 42 +++++++------- - src/server/game/Globals/ObjectMgr.cpp | 50 ++++++++--------- - src/server/game/Handlers/QuestHandler.cpp | 2 +- - src/server/game/Quests/QuestDef.cpp | 29 +++++----- - src/server/game/Quests/QuestDef.h | 65 +++++++++++++--------- - 7 files changed, 102 insertions(+), 92 deletions(-) - -diff --git a/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp b/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp -index f77499f..c6bfd33 100644 ---- a/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp -+++ b/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp -@@ -507,7 +507,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts() - case ACTION_T_QUEST_EVENT: - if (Quest const* qid = sObjectMgr->GetQuestTemplate(action.quest_event.questId)) - { -- if (!qid->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT)) -+ if (!qid->HasSpecialFlag(QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT)) - TC_LOG_ERROR(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u. SpecialFlags for quest entry %u does not include |2, Action will not have any effect.", i, j+1, action.quest_event.questId); - } - else -@@ -541,7 +541,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts() - case ACTION_T_QUEST_EVENT_ALL: - if (Quest const* qid = sObjectMgr->GetQuestTemplate(action.quest_event_all.questId)) - { -- if (!qid->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT)) -+ if (!qid->HasSpecialFlag(QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT)) - TC_LOG_ERROR(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u. SpecialFlags for quest entry %u does not include |2, Action will not have any effect.", i, j+1, action.quest_event_all.questId); - } - else -diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp -index 2e0fd22..081599c 100644 ---- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp -+++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp -@@ -696,7 +696,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) - case SMART_ACTION_CALL_GROUPEVENTHAPPENS: - if (Quest const* qid = sObjectMgr->GetQuestTemplate(e.action.quest.quest)) - { -- if (!qid->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT)) -+ if (!qid->HasSpecialFlag(QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT)) - { - TC_LOG_ERROR(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u SpecialFlags for Quest entry %u does not include FLAGS_EXPLORATION_OR_EVENT(2), skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.quest.quest); - return false; -diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp -index 9b38117..b1ee724 100644 ---- a/src/server/game/Entities/Player/Player.cpp -+++ b/src/server/game/Entities/Player/Player.cpp -@@ -14921,7 +14921,7 @@ bool Player::CanCompleteQuest(uint32 quest_id) - - if (q_status.Status == QUEST_STATUS_INCOMPLETE) - { -- if (qInfo->HasFlag(QUEST_TRINITY_FLAGS_DELIVER)) -+ if (qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_DELIVER)) - { - for (uint8 i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; i++) - { -@@ -14930,7 +14930,7 @@ bool Player::CanCompleteQuest(uint32 quest_id) - } - } - -- if (qInfo->HasFlag(QUEST_TRINITY_FLAGS_KILL | QUEST_TRINITY_FLAGS_CAST | QUEST_TRINITY_FLAGS_SPEAKTO)) -+ if (qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_KILL | QUEST_SPECIAL_FLAGS_CAST | QUEST_SPECIAL_FLAGS_SPEAKTO)) - { - for (uint8 i = 0; i < QUEST_OBJECTIVES_COUNT; i++) - { -@@ -14942,14 +14942,14 @@ bool Player::CanCompleteQuest(uint32 quest_id) - } - } - -- if (qInfo->HasFlag(QUEST_TRINITY_FLAGS_PLAYER_KILL)) -+ if (qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_PLAYER_KILL)) - if (qInfo->GetPlayersSlain() != 0 && q_status.PlayerCount < qInfo->GetPlayersSlain()) - return false; - -- if (qInfo->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT) && !q_status.Explored) -+ if (qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT) && !q_status.Explored) - return false; - -- if (qInfo->HasFlag(QUEST_TRINITY_FLAGS_TIMED) && q_status.Timer == 0) -+ if (qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_TIMED) && q_status.Timer == 0) - return false; - - if (qInfo->GetRewOrReqMoney() < 0) -@@ -14976,7 +14976,7 @@ bool Player::CanCompleteRepeatableQuest(Quest const* quest) - if (!CanTakeQuest(quest, false)) - return false; - -- if (quest->HasFlag(QUEST_TRINITY_FLAGS_DELIVER)) -+ if (quest->HasSpecialFlag(QUEST_SPECIAL_FLAGS_DELIVER)) - for (uint8 i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; i++) - if (quest->RequiredItemId[i] && quest->RequiredItemCount[i] && !HasItemCount(quest->RequiredItemId[i], quest->RequiredItemCount[i])) - return false; -@@ -15002,7 +15002,7 @@ bool Player::CanRewardQuest(Quest const* quest, bool msg) - return false; - - // prevent receive reward with quest items in bank -- if (quest->HasFlag(QUEST_TRINITY_FLAGS_DELIVER)) -+ if (quest->HasSpecialFlag(QUEST_SPECIAL_FLAGS_DELIVER)) - { - for (uint8 i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; i++) - { -@@ -15079,19 +15079,19 @@ void Player::AddQuest(Quest const* quest, Object* questGiver) - questStatusData.Status = QUEST_STATUS_INCOMPLETE; - questStatusData.Explored = false; - -- if (quest->HasFlag(QUEST_TRINITY_FLAGS_DELIVER)) -+ if (quest->HasSpecialFlag(QUEST_SPECIAL_FLAGS_DELIVER)) - { - for (uint8 i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i) - questStatusData.ItemCount[i] = 0; - } - -- if (quest->HasFlag(QUEST_TRINITY_FLAGS_KILL | QUEST_TRINITY_FLAGS_CAST | QUEST_TRINITY_FLAGS_SPEAKTO)) -+ if (quest->HasSpecialFlag(QUEST_SPECIAL_FLAGS_KILL | QUEST_SPECIAL_FLAGS_CAST | QUEST_SPECIAL_FLAGS_SPEAKTO)) - { - for (uint8 i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) - questStatusData.CreatureOrGOCount[i] = 0; - } - -- if (quest->HasFlag(QUEST_TRINITY_FLAGS_PLAYER_KILL)) -+ if (quest->HasSpecialFlag(QUEST_SPECIAL_FLAGS_PLAYER_KILL)) - questStatusData.PlayerCount = 0; - - GiveQuestSourceItem(quest); -@@ -15106,7 +15106,7 @@ void Player::AddQuest(Quest const* quest, Object* questGiver) - GetReputationMgr().SetVisible(factionEntry); - - uint32 qtime = 0; -- if (quest->HasFlag(QUEST_TRINITY_FLAGS_TIMED)) -+ if (quest->HasSpecialFlag(QUEST_SPECIAL_FLAGS_TIMED)) - { - uint32 limittime = quest->GetLimitTime(); - -@@ -15347,7 +15347,7 @@ void Player::FailQuest(uint32 questId) - SetQuestSlotState(log_slot, QUEST_STATE_FAIL); - } - -- if (quest->HasFlag(QUEST_TRINITY_FLAGS_TIMED)) -+ if (quest->HasSpecialFlag(QUEST_SPECIAL_FLAGS_TIMED)) - { - QuestStatusData& q_status = m_QuestStatus[questId]; - -@@ -15643,7 +15643,7 @@ bool Player::SatisfyQuestConditions(Quest const* qInfo, bool msg) - - bool Player::SatisfyQuestTimed(Quest const* qInfo, bool msg) - { -- if (!m_timedquests.empty() && qInfo->HasFlag(QUEST_TRINITY_FLAGS_TIMED)) -+ if (!m_timedquests.empty() && qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_TIMED)) - { - if (msg) - { -@@ -16003,7 +16003,7 @@ uint16 Player::GetReqKillOrCastCurrentCount(uint32 quest_id, int32 entry) - - void Player::AdjustQuestReqItemCount(Quest const* quest, QuestStatusData& questStatusData) - { -- if (quest->HasFlag(QUEST_TRINITY_FLAGS_DELIVER)) -+ if (quest->HasSpecialFlag(QUEST_SPECIAL_FLAGS_DELIVER)) - { - for (uint8 i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i) - { -@@ -16144,7 +16144,7 @@ void Player::ItemAddedQuestCheck(uint32 entry, uint32 count) - continue; - - Quest const* qInfo = sObjectMgr->GetQuestTemplate(questid); -- if (!qInfo || !qInfo->HasFlag(QUEST_TRINITY_FLAGS_DELIVER)) -+ if (!qInfo || !qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_DELIVER)) - continue; - - for (uint8 j = 0; j < QUEST_ITEM_OBJECTIVES_COUNT; ++j) -@@ -16182,7 +16182,7 @@ void Player::ItemRemovedQuestCheck(uint32 entry, uint32 count) - Quest const* qInfo = sObjectMgr->GetQuestTemplate(questid); - if (!qInfo) - continue; -- if (!qInfo->HasFlag(QUEST_TRINITY_FLAGS_DELIVER)) -+ if (!qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_DELIVER)) - continue; - - for (uint8 j = 0; j < QUEST_ITEM_OBJECTIVES_COUNT; ++j) -@@ -16254,7 +16254,7 @@ void Player::KilledMonsterCredit(uint32 entry, uint64 guid /*= 0*/) - QuestStatusData& q_status = m_QuestStatus[questid]; - if (q_status.Status == QUEST_STATUS_INCOMPLETE && (!GetGroup() || !GetGroup()->isRaidGroup() || qInfo->IsAllowedInRaid(GetMap()->GetDifficulty()))) - { -- if (qInfo->HasFlag(QUEST_TRINITY_FLAGS_KILL) /*&& !qInfo->HasFlag(QUEST_TRINITY_FLAGS_CAST)*/) -+ if (qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_KILL) /*&& !qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_CAST)*/) - { - for (uint8 j = 0; j < QUEST_OBJECTIVES_COUNT; ++j) - { -@@ -16305,7 +16305,7 @@ void Player::KilledPlayerCredit() - QuestStatusData& q_status = m_QuestStatus[questid]; - if (q_status.Status == QUEST_STATUS_INCOMPLETE && (!GetGroup() || !GetGroup()->isRaidGroup() || qInfo->IsAllowedInRaid(GetMap()->GetDifficulty()))) - { -- if (qInfo->HasFlag(QUEST_TRINITY_FLAGS_PLAYER_KILL)) -+ if (qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_PLAYER_KILL)) - { - uint32 reqkill = qInfo->GetPlayersSlain(); - uint16 curkill = q_status.PlayerCount; -@@ -16345,7 +16345,7 @@ void Player::KillCreditGO(uint32 entry, uint64 guid) - - if (q_status.Status == QUEST_STATUS_INCOMPLETE) - { -- if (qInfo->HasFlag(QUEST_TRINITY_FLAGS_CAST) /*&& !qInfo->HasFlag(QUEST_TRINITY_FLAGS_KILL)*/) -+ if (qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_CAST) /*&& !qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_KILL)*/) - { - for (uint8 j = 0; j < QUEST_OBJECTIVES_COUNT; ++j) - { -@@ -16399,7 +16399,7 @@ void Player::TalkedToCreature(uint32 entry, uint64 guid) - - if (q_status.Status == QUEST_STATUS_INCOMPLETE) - { -- if (qInfo->HasFlag(QUEST_TRINITY_FLAGS_KILL | QUEST_TRINITY_FLAGS_CAST | QUEST_TRINITY_FLAGS_SPEAKTO)) -+ if (qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_KILL | QUEST_SPECIAL_FLAGS_CAST | QUEST_SPECIAL_FLAGS_SPEAKTO)) - { - for (uint8 j = 0; j < QUEST_OBJECTIVES_COUNT; ++j) - { -@@ -18188,7 +18188,7 @@ void Player::_LoadQuestStatus(PreparedQueryResult result) - - time_t quest_time = time_t(fields[3].GetUInt32()); - -- if (quest->HasFlag(QUEST_TRINITY_FLAGS_TIMED) && !GetQuestRewardStatus(quest_id)) -+ if (quest->HasSpecialFlag(QUEST_SPECIAL_FLAGS_TIMED) && !GetQuestRewardStatus(quest_id)) - { - AddTimedQuest(quest_id); - -diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp -index 804967c..eaf2306 100644 ---- a/src/server/game/Globals/ObjectMgr.cpp -+++ b/src/server/game/Globals/ObjectMgr.cpp -@@ -3765,11 +3765,11 @@ void ObjectMgr::LoadQuests() - if (qinfo->GetQuestMethod() >= 3) - TC_LOG_ERROR(LOG_FILTER_SQL, "Quest %u has `Method` = %u, expected values are 0, 1 or 2.", qinfo->GetQuestId(), qinfo->GetQuestMethod()); - -- if (qinfo->Flags & ~QUEST_TRINITY_FLAGS_DB_ALLOWED) -+ if (qinfo->SpecialFlags & ~QUEST_SPECIAL_FLAGS_DB_ALLOWED) - { - TC_LOG_ERROR(LOG_FILTER_SQL, "Quest %u has `SpecialFlags` = %u > max allowed value. Correct `SpecialFlags` to value <= %u", -- qinfo->GetQuestId(), qinfo->Flags >> 20, QUEST_TRINITY_FLAGS_DB_ALLOWED >> 20); -- qinfo->Flags &= QUEST_TRINITY_FLAGS_DB_ALLOWED; -+ qinfo->GetQuestId(), qinfo->SpecialFlags, QUEST_SPECIAL_FLAGS_DB_ALLOWED); -+ qinfo->SpecialFlags &= QUEST_SPECIAL_FLAGS_DB_ALLOWED; - } - - if (qinfo->Flags & QUEST_FLAGS_DAILY && qinfo->Flags & QUEST_FLAGS_WEEKLY) -@@ -3778,30 +3778,30 @@ void ObjectMgr::LoadQuests() - qinfo->Flags &= ~QUEST_FLAGS_DAILY; - } - -- if (qinfo->Flags & QUEST_FLAGS_DAILY) -+ if (!(qinfo->SpecialFlags & QUEST_SPECIAL_FLAGS_REPEATABLE)) - { -- if (!(qinfo->Flags & QUEST_TRINITY_FLAGS_REPEATABLE)) -+ if (!(qinfo->Flags & QUEST_FLAGS_DAILY)) - { - TC_LOG_ERROR(LOG_FILTER_SQL, "Daily Quest %u not marked as repeatable in `SpecialFlags`, added.", qinfo->GetQuestId()); -- qinfo->Flags |= QUEST_TRINITY_FLAGS_REPEATABLE; -+ qinfo->SpecialFlags |= QUEST_SPECIAL_FLAGS_REPEATABLE; - } - } - - if (qinfo->Flags & QUEST_FLAGS_WEEKLY) - { -- if (!(qinfo->Flags & QUEST_TRINITY_FLAGS_REPEATABLE)) -+ if (!(qinfo->SpecialFlags & QUEST_SPECIAL_FLAGS_REPEATABLE)) - { - TC_LOG_ERROR(LOG_FILTER_SQL, "Weekly Quest %u not marked as repeatable in `SpecialFlags`, added.", qinfo->GetQuestId()); -- qinfo->Flags |= QUEST_TRINITY_FLAGS_REPEATABLE; -+ qinfo->SpecialFlags |= QUEST_SPECIAL_FLAGS_REPEATABLE; - } - } - -- if (qinfo->Flags & QUEST_TRINITY_FLAGS_MONTHLY) -+ if (qinfo->SpecialFlags & QUEST_SPECIAL_FLAGS_MONTHLY) - { -- if (!(qinfo->Flags & QUEST_TRINITY_FLAGS_REPEATABLE)) -+ if (!(qinfo->SpecialFlags & QUEST_SPECIAL_FLAGS_REPEATABLE)) - { - TC_LOG_ERROR(LOG_FILTER_SQL, "Monthly quest %u not marked as repeatable in `SpecialFlags`, added.", qinfo->GetQuestId()); -- qinfo->Flags |= QUEST_TRINITY_FLAGS_REPEATABLE; -+ qinfo->SpecialFlags |= QUEST_SPECIAL_FLAGS_REPEATABLE; - } - } - -@@ -4019,7 +4019,7 @@ void ObjectMgr::LoadQuests() - // no changes, quest can't be done for this requirement - } - -- qinfo->SetFlag(QUEST_TRINITY_FLAGS_DELIVER); -+ qinfo->SetSpecialFlag(QUEST_SPECIAL_FLAGS_DELIVER); - - if (!sObjectMgr->GetItemTemplate(id)) - { -@@ -4080,7 +4080,7 @@ void ObjectMgr::LoadQuests() - { - // In fact SpeakTo and Kill are quite same: either you can speak to mob:SpeakTo or you can't:Kill/Cast - -- qinfo->SetFlag(QUEST_TRINITY_FLAGS_KILL | QUEST_TRINITY_FLAGS_CAST | QUEST_TRINITY_FLAGS_SPEAKTO); -+ qinfo->SetSpecialFlag(QUEST_SPECIAL_FLAGS_KILL | QUEST_SPECIAL_FLAGS_CAST | QUEST_SPECIAL_FLAGS_SPEAKTO); - - if (!qinfo->RequiredNpcOrGoCount[j]) - { -@@ -4290,12 +4290,12 @@ void ObjectMgr::LoadQuests() - if (qinfo->ExclusiveGroup) - mExclusiveQuestGroups.insert(std::pair(qinfo->ExclusiveGroup, qinfo->GetQuestId())); - if (qinfo->LimitTime) -- qinfo->SetFlag(QUEST_TRINITY_FLAGS_TIMED); -+ qinfo->SetSpecialFlag(QUEST_SPECIAL_FLAGS_TIMED); - if (qinfo->RequiredPlayerKills) -- qinfo->SetFlag(QUEST_TRINITY_FLAGS_PLAYER_KILL); -+ qinfo->SetSpecialFlag(QUEST_SPECIAL_FLAGS_PLAYER_KILL); - } - -- // check QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT for spell with SPELL_EFFECT_QUEST_COMPLETE -+ // check QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT for spell with SPELL_EFFECT_QUEST_COMPLETE - for (uint32 i = 0; i < sSpellMgr->GetSpellInfoStoreSize(); ++i) - { - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(i); -@@ -4315,12 +4315,12 @@ void ObjectMgr::LoadQuests() - if (!quest) - continue; - -- if (!quest->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT)) -+ if (!quest->HasSpecialFlag(QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT)) - { -- TC_LOG_ERROR(LOG_FILTER_SQL, "Spell (id: %u) have SPELL_EFFECT_QUEST_COMPLETE for quest %u, but quest not have flag QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT. Quest flags must be fixed, quest modified to enable objective.", spellInfo->Id, quest_id); -+ TC_LOG_ERROR(LOG_FILTER_SQL, "Spell (id: %u) have SPELL_EFFECT_QUEST_COMPLETE for quest %u, but quest not have flag QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT. Quest flags must be fixed, quest modified to enable objective.", spellInfo->Id, quest_id); - - // this will prevent quest completing without objective -- const_cast(quest)->SetFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT); -+ const_cast(quest)->SetSpecialFlag(QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT); - } - } - } -@@ -4491,13 +4491,13 @@ void ObjectMgr::LoadScripts(ScriptsType type) - continue; - } - -- if (!quest->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT)) -+ if (!quest->HasSpecialFlag(QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT)) - { -- TC_LOG_ERROR(LOG_FILTER_SQL, "Table `%s` has quest (ID: %u) in SCRIPT_COMMAND_QUEST_EXPLORED in `datalong` for script id %u, but quest not have flag QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT in quest flags. Script command or quest flags wrong. Quest modified to require objective.", -+ TC_LOG_ERROR(LOG_FILTER_SQL, "Table `%s` has quest (ID: %u) in SCRIPT_COMMAND_QUEST_EXPLORED in `datalong` for script id %u, but quest not have flag QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT in quest flags. Script command or quest flags wrong. Quest modified to require objective.", - tableName.c_str(), tmp.QuestExplored.QuestID, tmp.id); - - // this will prevent quest completing without objective -- const_cast(quest)->SetFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT); -+ const_cast(quest)->SetSpecialFlag(QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT); - - // continue; - quest objective requirement set and command can be allowed - } -@@ -5390,12 +5390,12 @@ void ObjectMgr::LoadQuestAreaTriggers() - continue; - } - -- if (!quest->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT)) -+ if (!quest->HasSpecialFlag(QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT)) - { -- TC_LOG_ERROR(LOG_FILTER_SQL, "Table `areatrigger_involvedrelation` has record (id: %u) for not quest %u, but quest not have flag QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT. Trigger or quest flags must be fixed, quest modified to require objective.", trigger_ID, quest_ID); -+ TC_LOG_ERROR(LOG_FILTER_SQL, "Table `areatrigger_involvedrelation` has record (id: %u) for not quest %u, but quest not have flag QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT. Trigger or quest flags must be fixed, quest modified to require objective.", trigger_ID, quest_ID); - - // this will prevent quest completing without objective -- const_cast(quest)->SetFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT); -+ const_cast(quest)->SetSpecialFlag(QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT); - - // continue; - quest modified to required objective and trigger can be allowed. - } -diff --git a/src/server/game/Handlers/QuestHandler.cpp b/src/server/game/Handlers/QuestHandler.cpp -index e51d87c..e032c82 100644 ---- a/src/server/game/Handlers/QuestHandler.cpp -+++ b/src/server/game/Handlers/QuestHandler.cpp -@@ -450,7 +450,7 @@ void WorldSession::HandleQuestLogRemoveQuest(WorldPacket& recvData) - - if (Quest const* quest = sObjectMgr->GetQuestTemplate(questId)) - { -- if (quest->HasFlag(QUEST_TRINITY_FLAGS_TIMED)) -+ if (quest->HasSpecialFlag(QUEST_SPECIAL_FLAGS_TIMED)) - _player->RemoveTimedQuest(questId); - - if (quest->HasFlag(QUEST_FLAGS_FLAGS_PVP)) -diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp -index 7345dca..f2e80bd 100644 ---- a/src/server/game/Quests/QuestDef.cpp -+++ b/src/server/game/Quests/QuestDef.cpp -@@ -60,7 +60,7 @@ Quest::Quest(Field* questRecord) - SourceItemIdCount = questRecord[35].GetUInt8(); - SourceSpellid = questRecord[36].GetUInt32(); - Flags = questRecord[37].GetUInt32(); -- uint32 SpecialFlags = questRecord[38].GetUInt8(); -+ SpecialFlags = questRecord[38].GetUInt8(); - RewardTitleId = questRecord[39].GetUInt8(); - RequiredPlayerKills = questRecord[40].GetUInt8(); - RewardTalents = questRecord[41].GetUInt8(); -@@ -139,30 +139,29 @@ Quest::Quest(Field* questRecord) - - //int32 WDBVerified = questRecord[140].GetInt32(); - -- Flags |= SpecialFlags << 20; -- if (Flags & QUEST_TRINITY_FLAGS_AUTO_ACCEPT) -+ if (SpecialFlags & QUEST_SPECIAL_FLAGS_AUTO_ACCEPT) - Flags |= QUEST_FLAGS_AUTO_ACCEPT; - -- m_reqitemscount = 0; -- m_reqCreatureOrGOcount = 0; -- m_rewitemscount = 0; -- m_rewchoiceitemscount = 0; -+ _reqItemsCount = 0; -+ _reqCreatureOrGOcount = 0; -+ _rewItemsCount = 0; -+ _rewChoiceItemsCount = 0; - -- for (int i=0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i) -+ for (int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i) - if (RequiredItemId[i]) -- ++m_reqitemscount; -+ ++_reqItemsCount; - -- for (int i=0; i < QUEST_OBJECTIVES_COUNT; ++i) -+ for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) - if (RequiredNpcOrGo[i]) -- ++m_reqCreatureOrGOcount; -+ ++_reqCreatureOrGOcount; - -- for (int i=0; i < QUEST_REWARDS_COUNT; ++i) -+ for (int i = 0; i < QUEST_REWARDS_COUNT; ++i) - if (RewardItemId[i]) -- ++m_rewitemscount; -+ ++_rewItemsCount; - -- for (int i=0; i < QUEST_REWARD_CHOICES_COUNT; ++i) -+ for (int i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i) - if (RewardChoiceItemId[i]) -- ++m_rewchoiceitemscount; -+ ++_rewChoiceItemsCount; - } - - uint32 Quest::XPValue(Player* player) const -diff --git a/src/server/game/Quests/QuestDef.h b/src/server/game/Quests/QuestDef.h -index b279665..88a4ddf 100644 ---- a/src/server/game/Quests/QuestDef.h -+++ b/src/server/game/Quests/QuestDef.h -@@ -75,7 +75,7 @@ enum QuestShareMessages - QUEST_PARTY_MSG_NOT_IN_PARTY = 10 - }; - --enum __QuestTradeSkill -+enum QuestTradeSkill - { - QUEST_TRSKILL_NONE = 0, - QUEST_TRSKILL_ALCHEMY = 1, -@@ -106,7 +106,7 @@ enum QuestStatus - MAX_QUEST_STATUS - }; - --enum __QuestGiverStatus -+enum QuestGiverStatus - { - DIALOG_STATUS_NONE = 0, - DIALOG_STATUS_UNAVAILABLE = 1, -@@ -146,22 +146,28 @@ enum QuestFlags - QUEST_FLAGS_OBJ_TEXT = 0x00040000, // use Objective text as Complete text - QUEST_FLAGS_AUTO_ACCEPT = 0x00080000, // The client recognizes this flag as auto-accept. However, NONE of the current quests (3.3.5a) have this flag. Maybe blizz used to use it, or will use it in the future. - -+ // ... 4.x added flags up to 0x80000000 - all unknown for now -+}; -+ -+enum QuestSpecialFlags -+{ -+ QUEST_SPECIAL_FLAGS_NONE = 0x000, - // Trinity flags for set SpecialFlags in DB if required but used only at server -- QUEST_TRINITY_FLAGS_REPEATABLE = 0x00100000, // Set by 1 in SpecialFlags from DB -- QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT = 0x00200000, // Set by 2 in SpecialFlags from DB (if reequired area explore, spell SPELL_EFFECT_QUEST_COMPLETE casting, table `*_script` command SCRIPT_COMMAND_QUEST_EXPLORED use, set from script) -- QUEST_TRINITY_FLAGS_AUTO_ACCEPT = 0x00400000, // Set by 4 in SpecialFlags in DB if the quest is to be auto-accepted. -- QUEST_TRINITY_FLAGS_DF_QUEST = 0x00800000, // Set by 8 in SpecialFlags in DB if the quest is used by Dungeon Finder. -- QUEST_TRINITY_FLAGS_MONTHLY = 0x01000000, // Set by 16 in SpecialFlags in DB if the quest is reset at the begining of the month -- QUEST_TRINITY_FLAGS_CAST = 0x02000000, // Set by 32 in SpecialFlags in DB if the quest requires RequiredOrNpcGo killcredit but NOT kill (a spell cast) -- -- QUEST_TRINITY_FLAGS_DB_ALLOWED = 0xFFFFF | QUEST_TRINITY_FLAGS_REPEATABLE | QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT | QUEST_TRINITY_FLAGS_AUTO_ACCEPT | QUEST_TRINITY_FLAGS_DF_QUEST | QUEST_TRINITY_FLAGS_MONTHLY | QUEST_TRINITY_FLAGS_CAST, -+ QUEST_SPECIAL_FLAGS_REPEATABLE = 0x001, // Set by 1 in SpecialFlags from DB -+ QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT = 0x002, // Set by 2 in SpecialFlags from DB (if required area explore, spell SPELL_EFFECT_QUEST_COMPLETE casting, table `FECT_QUEST_COMPLETE casting, table `*_script` command SCRIPT_COMMAND_QUEST_EXPLORED use, set from script) -+ QUEST_SPECIAL_FLAGS_AUTO_ACCEPT = 0x004, // Set by 4 in SpecialFlags in DB if the quest is to be auto-accepted. -+ QUEST_SPECIAL_FLAGS_DF_QUEST = 0x008, // Set by 8 in SpecialFlags in DB if the quest is used by Dungeon Finder. -+ QUEST_SPECIAL_FLAGS_MONTHLY = 0x010, // Set by 16 in SpecialFlags in DB if the quest is reset at the begining of the month -+ QUEST_SPECIAL_FLAGS_CAST = 0x020, // Set by 32 in SpecialFlags in DB if the quest requires RequiredOrNpcGo killcredit but NOT kill (a spell cast) -+ // room for more custom flags - -- // Trinity flags for internal use only -- QUEST_TRINITY_FLAGS_DELIVER = 0x04000000, // Internal flag computed only -- QUEST_TRINITY_FLAGS_SPEAKTO = 0x08000000, // Internal flag computed only -- QUEST_TRINITY_FLAGS_KILL = 0x10000000, // Internal flag computed only -- QUEST_TRINITY_FLAGS_TIMED = 0x20000000, // Internal flag computed only -- QUEST_TRINITY_FLAGS_PLAYER_KILL = 0x40000000 // Internal flag computed only -+ QUEST_SPECIAL_FLAGS_DB_ALLOWED = QUEST_SPECIAL_FLAGS_REPEATABLE | QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT | QUEST_SPECIAL_FLAGS_AUTO_ACCEPT | QUEST_SPECIAL_FLAGS_DF_QUEST | QUEST_SPECIAL_FLAGS_MONTHLY | QUEST_SPECIAL_FLAGS_CAST, -+ -+ QUEST_SPECIAL_FLAGS_DELIVER = 0x080, // Internal flag computed only -+ QUEST_SPECIAL_FLAGS_SPEAKTO = 0x100, // Internal flag computed only -+ QUEST_SPECIAL_FLAGS_KILL = 0x200, // Internal flag computed only -+ QUEST_SPECIAL_FLAGS_TIMED = 0x400, // Internal flag computed only -+ QUEST_SPECIAL_FLAGS_PLAYER_KILL = 0x800 // Internal flag computed only - }; - - struct QuestLocale -@@ -191,6 +197,9 @@ class Quest - bool HasFlag(uint32 flag) const { return (Flags & flag) != 0; } - void SetFlag(uint32 flag) { Flags |= flag; } - -+ bool HasSpecialFlag(uint32 flag) const { return (SpecialFlags & flag) != 0; } -+ void SetSpecialFlag(uint32 flag) { SpecialFlags |= flag; } -+ - // table data accessors: - uint32 GetQuestId() const { return Id; } - uint32 GetQuestMethod() const { return Method; } -@@ -246,18 +255,18 @@ class Quest - uint32 GetPointOpt() const { return PointOption; } - uint32 GetIncompleteEmote() const { return EmoteOnIncomplete; } - uint32 GetCompleteEmote() const { return EmoteOnComplete; } -- bool IsRepeatable() const { return Flags & QUEST_TRINITY_FLAGS_REPEATABLE; } -+ bool IsRepeatable() const { return SpecialFlags & QUEST_SPECIAL_FLAGS_REPEATABLE; } - bool IsAutoAccept() const; - bool IsAutoComplete() const; - uint32 GetFlags() const { return Flags; } - bool IsDaily() const { return Flags & QUEST_FLAGS_DAILY; } - bool IsWeekly() const { return Flags & QUEST_FLAGS_WEEKLY; } -- bool IsMonthly() const { return Flags & QUEST_TRINITY_FLAGS_MONTHLY; } -+ bool IsMonthly() const { return SpecialFlags & QUEST_SPECIAL_FLAGS_MONTHLY; } - bool IsSeasonal() const { return (ZoneOrSort == -QUEST_SORT_SEASONAL || ZoneOrSort == -QUEST_SORT_SPECIAL || ZoneOrSort == -QUEST_SORT_LUNAR_FESTIVAL || ZoneOrSort == -QUEST_SORT_MIDSUMMER || ZoneOrSort == -QUEST_SORT_BREWFEST || ZoneOrSort == -QUEST_SORT_LOVE_IS_IN_THE_AIR || ZoneOrSort == -QUEST_SORT_NOBLEGARDEN) && !IsRepeatable(); } - bool IsDailyOrWeekly() const { return Flags & (QUEST_FLAGS_DAILY | QUEST_FLAGS_WEEKLY); } - bool IsRaidQuest(Difficulty difficulty) const; - bool IsAllowedInRaid(Difficulty difficulty) const; -- bool IsDFQuest() const { return Flags & QUEST_TRINITY_FLAGS_DF_QUEST; } -+ bool IsDFQuest() const { return SpecialFlags & QUEST_SPECIAL_FLAGS_DF_QUEST; } - uint32 CalculateHonorGain(uint8 level) const; - - // multiple values -@@ -280,10 +289,10 @@ class Quest - uint32 OfferRewardEmote[QUEST_EMOTE_COUNT]; - uint32 OfferRewardEmoteDelay[QUEST_EMOTE_COUNT]; - -- uint32 GetReqItemsCount() const { return m_reqitemscount; } -- uint32 GetReqCreatureOrGOcount() const { return m_reqCreatureOrGOcount; } -- uint32 GetRewChoiceItemsCount() const { return m_rewchoiceitemscount; } -- uint32 GetRewItemsCount() const { return m_rewitemscount; } -+ uint32 GetReqItemsCount() const { return _reqItemsCount; } -+ uint32 GetReqCreatureOrGOcount() const { return _reqCreatureOrGOcount; } -+ uint32 GetRewChoiceItemsCount() const { return _rewChoiceItemsCount; } -+ uint32 GetRewItemsCount() const { return _rewItemsCount; } - - typedef std::vector PrevQuests; - PrevQuests prevQuests; -@@ -292,10 +301,10 @@ class Quest - - // cached data - private: -- uint32 m_reqitemscount; -- uint32 m_reqCreatureOrGOcount; -- uint32 m_rewchoiceitemscount; -- uint32 m_rewitemscount; -+ uint32 _reqItemsCount; -+ uint32 _reqCreatureOrGOcount; -+ uint32 _rewChoiceItemsCount; -+ uint32 _rewItemsCount; - - // table data - protected: -@@ -354,6 +363,8 @@ class Quest - uint32 PointOption; - uint32 EmoteOnIncomplete; - uint32 EmoteOnComplete; -+ -+ uint32 SpecialFlags; // custom flags, not sniffed/WDB - }; - - struct QuestStatusData +ALTER TABLE `reputation_reward_rate` CHANGE `quest_repeatable_rate` `quest_repeatable_rate` FLOAT NOT NULL DEFAULT '1' AFTER `quest_monthly_rate`; -- cgit v1.2.3 From 2d93059114087dee62006875063c3e8f5417493a Mon Sep 17 00:00:00 2001 From: Nay Date: Sat, 31 Aug 2013 12:45:44 +0100 Subject: SQL: Fix a typo in e375c6075b214b85599 --- sql/updates/world/2013_08_30_00_world_gameobject_loot_template.sql | 2 +- sql/updates/world/2013_08_31_01_world_gameobject_loot_template.sql | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 sql/updates/world/2013_08_31_01_world_gameobject_loot_template.sql (limited to 'sql/updates') diff --git a/sql/updates/world/2013_08_30_00_world_gameobject_loot_template.sql b/sql/updates/world/2013_08_30_00_world_gameobject_loot_template.sql index 3e6ed052f34..69223384be1 100644 --- a/sql/updates/world/2013_08_30_00_world_gameobject_loot_template.sql +++ b/sql/updates/world/2013_08_30_00_world_gameobject_loot_template.sql @@ -1 +1 @@ -UPDATE `gameobject_loot_template` SET `item`=33700 WHERE `entry`=24157 AND `item`=37703; +UPDATE `gameobject_loot_template` SET `item`=37700 /* 33700 */ WHERE `entry`=24157 AND `item`=37703; diff --git a/sql/updates/world/2013_08_31_01_world_gameobject_loot_template.sql b/sql/updates/world/2013_08_31_01_world_gameobject_loot_template.sql new file mode 100644 index 00000000000..85f033443bf --- /dev/null +++ b/sql/updates/world/2013_08_31_01_world_gameobject_loot_template.sql @@ -0,0 +1 @@ +UPDATE `gameobject_loot_template` SET `item`=37700 WHERE `entry`=24157 AND `item`=33700; -- cgit v1.2.3 From a2ee732a38ff8c0c366a57d5942368982443d8b7 Mon Sep 17 00:00:00 2001 From: Filip Date: Sat, 31 Aug 2013 14:53:46 +0200 Subject: DB/SAI: The Lost Mistwhisper Treasure (12575) --- sql/updates/world/2013_08_31_02_world_sai.sql | 83 +++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 sql/updates/world/2013_08_31_02_world_sai.sql (limited to 'sql/updates') diff --git a/sql/updates/world/2013_08_31_02_world_sai.sql b/sql/updates/world/2013_08_31_02_world_sai.sql new file mode 100644 index 00000000000..9a34b6fcf99 --- /dev/null +++ b/sql/updates/world/2013_08_31_02_world_sai.sql @@ -0,0 +1,83 @@ +-- The Lost Mistwhisper Treasure (12575) +SET @TARTEK := 28105; +SET @ZEPTEK := 28399; +SET @HC_RIDE := 46598; +SET @TRIGGER := 5030; +SET @SPEARBORNBUNNY := 28457; +-- REF 6710.741, 5154.322, -19.3981 +-- REF 6712.461, 5136.462, -19.3981 + +-- Propper phasing +DELETE FROM `spell_area` WHERE `spell` = 52217; +INSERT INTO `spell_area` (`spell`, `area`, `quest_start`, `quest_end`, `aura_spell`, `racemask`, `gender`, `autocast`, `quest_start_status`, `quest_end_status`) VALUES +(52217, 4306, 12574, 0, 0, 0, 2, 1, 74, 64), +(52217, 4308, 12574, 0, 0, 0, 2, 1, 74, 64); + +-- Needs one waypoint for passenger removal +DELETE FROM `waypoints` WHERE `entry`=@ZEPTEK; +INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES +(@ZEPTEK, 1, 6712.461, 5136.462, -19.3981, 'Zeptek the Destroyer'); + +-- Criteria linked with involved relation +DELETE FROM `areatrigger_involvedrelation` WHERE `id` = @TRIGGER; +INSERT INTO `areatrigger_involvedrelation` (`id`,`quest`) VALUES +(@TRIGGER,12575); + +DELETE FROM `areatrigger_scripts` WHERE `entry` = @TRIGGER; +INSERT INTO `areatrigger_scripts` (`entry`, `ScriptName`) VALUES +(@TRIGGER,'SmartTrigger'); + +DELETE FROM `smart_scripts` WHERE `entryorguid` =@TRIGGER AND `source_type`=2; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@TRIGGER,2,0,0,46,0,100,0,@TRIGGER,0,0,0,45,1,1,0,0,0,0,10,99764,@SPEARBORNBUNNY,0,0,0,0,0,"On Trigger - Set Data"); + +DELETE FROM `smart_scripts` WHERE `entryorguid` =@SPEARBORNBUNNY AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@SPEARBORNBUNNY,0,0,0,10,0,100,0,1,200,10000,10000,11,51642,2,0,0,0,0,7,0,0,0,0,0,0,0,'Spearborn Encampment Bunny - On update OOC - Spellcast Spearborn Encampment Aura'), +(@SPEARBORNBUNNY,0,1,2,38,0,100,0,1,1,300000,300000,45,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Spearborn Encampment Bunny - On Data Set - Set Data'), +(@SPEARBORNBUNNY,0,2,0,61,0,100,0,0,0,0,0,12,@TARTEK,1,300000,0,0,0,8,0,0,0,6709.02, 5169.21, -20.8878, 4.91029, 'Spearborn Encampment Bunny - Linked with Previous Event - Spawn Warlord Tartek'); + +DELETE FROM `creature` WHERE `id`=@TARTEK; +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=@TARTEK; +DELETE FROM `creature_ai_scripts` WHERE `creature_id` =@TARTEK; +DELETE FROM `smart_scripts` WHERE `entryorguid` =@TARTEK; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(@TARTEK,0,0,1,11,0,100,0,0,0,0,0,2,2061,0,0,0,0,0,1,0,0,0,0,0,0,0,'Warlord Tartek - On Spawn - Set Faction'), +(@TARTEK,0,1,2,61,0,100,0,0,0,0,0,18,756,0,0,0,0,0,1,0,0,0,0,0,0,0,'Warlord Tartek - On Link - Set Unattackable Flags'), +(@TARTEK,0,2,3,61,0,100,0,0,0,0,0,12,@ZEPTEK,1,100000,0,0,0,1,0,0,0,0,0,0,0,'Warlord Tartek - On Link - Summon Zeptek'), +(@TARTEK,0,3,4,61,0,100,0,0,0,0,0,11,@HC_RIDE,2,0,0,0,0,11,@ZEPTEK,10,0,0,0,0,0,'Warlord Tartek - On Link - Ride Zeptek'), +(@TARTEK,0,4,5,61,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Warlord Tartek - On Link - Say 0'), +(@TARTEK,0,5,0,4,0,100,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Warlord Tartek - On Aggro - Say 1'), +(@TARTEK,0,6,0,8,0,100,0,@HC_RIDE,0,0,0,19,756,0,0,0,0,0,1,0,0,0,0,0,0,0,'Warlord Tartek - On Data set - Remove Unattackable Flags'), +-- Combat +(@TARTEK,0,7,0,9,0,100,0,5000,8000,5000,8000,11,29426,2,0,0,0,0,1,0,0,0,0,0,0,0,'Warlord Tartek - IC - Cast Heroic Strike'), +(@TARTEK,0,8,0,0,0,100,0,5000,15000,5000,15000,11,35429,2,0,0,0,0,1,0,0,0,0,0,0,0,'Warlord Tartek - IC - Cast Sweeping Strikes'), +(@TARTEK,0,9,0,0,0,100,0,6000,15000,6000,15000,11,15572,2,0,0,0,0,2,0,0,0,0,0,0,0,'Warlord Tartek - IC - Cast Sunder Armor'), +-- Credit +(@TARTEK,0,10,11,6,0,100,0,0,0,0,0,45,1,1,0,0,0,0,9,28121,0,50,0,0,0,0, 'Warlord Tartek - On Death - Set Data Jaloot'), -- If spawned by player, will say text. +(@TARTEK,0,11,0,61,0,100,0,0,0,0,0,15,12575,0,0,0,0,0,7,0,0,0,0,0,0,0,'Warlord Tartek - On Link - Call area explored or event happens'); + +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=@ZEPTEK; +DELETE FROM `creature_ai_scripts` WHERE `creature_id` =@ZEPTEK; +DELETE FROM `smart_scripts` WHERE `entryorguid` =@ZEPTEK; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(@ZEPTEK,0,0,1,11,0,100,0,0,0,0,0,2,2061,0,0,0,0,0,1,0,0,0,0,0,0,0,'Zeptik The Destroyer - On Spawn - Set Faction'), +(@ZEPTEK,0,1,0,61,0,100,0,0,0,0,0,53,1,@ZEPTEK,0,0,0,0,1,0,0,0,0,0,0,0,'Zeptik The Destroyer - On Link - Start WP'), +(@ZEPTEK,0,2,3,40,0,100,0,1,0,0,0,11,@HC_RIDE,0,0,0,0,0,11,@TARTEK,20,0,0,0,0,0,'Zeptik The Destroyer - ON WP reached - Dismount Tartek'), +(@ZEPTEK,0,3,4,61,0,100,0,0,0,0,0,8,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Zeptik The Destroyer - OnLink - Summon New Zeptek'), +(@ZEPTEK,0,4,0,61,0,100,0,0,0,0,0,28,@HC_RIDE,0,0,0,0,0,1,0,0,0,0,0,0,0,'Zeptik The Destroyer - On LInk - Attack Closest Player'); + +DELETE FROM `creature_equip_template` WHERE `entry` =@TARTEK; +INSERT INTO `creature_equip_template` (`entry`, `id`, `itemEntry1`, `itemEntry2`, `itemEntry3`) VALUES +(@TARTEK, 1, 5305, 0, 0); + +DELETE FROM `creature_text` WHERE `entry` =@TARTEK; +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`) VALUES +(@TARTEK, 0, 0, 'My treasure! You no steal from Tartek, dumb big-tongue traitor thing.', 14, 0, 100, 0, 0, 0, 'Warlord Tartek'), +(@TARTEK, 1, 0, 'Tartek and nasty dragon going to kill you! You so dumb.', 14, 0, 100, 0, 0, 0, 'Warlord Tartek'); +-- Needs special flags 2 for external event +UPDATE `quest_template` SET `SpecialFlags`=2 WHERE `Id`=12575; + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=22 AND `SourceEntry`=@TRIGGER AND `SourceId`=2; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(22,1,@TRIGGER,2,0,9,0,12575,0,0,0,0,'','Trigger only activates if player is on the Lost Mistwhisper Treasure'); -- cgit v1.2.3 From ae36ddefec4f5ab6eea615ddd7a45cbdcb580b5a Mon Sep 17 00:00:00 2001 From: joschiwald Date: Sat, 31 Aug 2013 16:48:37 +0200 Subject: Core/Scripts: add creature_text to pet mojo Scripts/Karazhan/Moroes: cleanup a bit (should fixes mem leak) --- .../world/2013_08_31_03_world_creature_text.sql | 10 ++ .../EasternKingdoms/Karazhan/boss_moroes.cpp | 40 ++--- src/server/scripts/World/npcs_special.cpp | 167 ++++++++------------- 3 files changed, 92 insertions(+), 125 deletions(-) create mode 100644 sql/updates/world/2013_08_31_03_world_creature_text.sql (limited to 'sql/updates') diff --git a/sql/updates/world/2013_08_31_03_world_creature_text.sql b/sql/updates/world/2013_08_31_03_world_creature_text.sql new file mode 100644 index 00000000000..ca8133784d1 --- /dev/null +++ b/sql/updates/world/2013_08_31_03_world_creature_text.sql @@ -0,0 +1,10 @@ +DELETE FROM `creature_text` WHERE `entry`=24480; +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`) VALUES +(24480, 0, 0, 'I thought you''d never ask!', 15, 0, 100, 0, 0, 0, 'Mojo'), +(24480, 0, 1, 'I promise not to give you warts...', 15, 0, 100, 0, 0, 0, 'Mojo'), +(24480, 0, 2, 'This won''t take long, did it?', 15, 0, 100, 0, 0, 0, 'Mojo'), +(24480, 0, 3, 'Now that''s what I call froggy-style!', 15, 0, 100, 0, 0, 0, 'Mojo'), +(24480, 0, 4, 'Listen, $n, I know of a little swamp not too far from here....', 15, 0, 100, 0, 0, 0, 'Mojo'), +(24480, 0, 5, 'Your lily pad or mine?', 15, 0, 100, 0, 0, 0, 'Mojo'), +(24480, 0, 6, 'Feelin'' a little froggy, are ya?', 15, 0, 100, 0, 0, 0, 'Mojo'), +(24480, 0, 7, 'There''s just never enough Mojo to go around...', 15, 0, 100, 0, 0, 0, 'Mojo'); diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp index 473fe000939..780f781f58d 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp @@ -73,14 +73,12 @@ enum Spells SPELL_SHIELDWALL = 29390 }; -#define POS_Z 81.73f - -float Locations[4][3]= +Position const Locations[4] = { - {-10991.0f, -1884.33f, 0.614315f}, - {-10989.4f, -1885.88f, 0.904913f}, - {-10978.1f, -1887.07f, 2.035550f}, - {-10975.9f, -1885.81f, 2.253890f}, + {-10991.0f, -1884.33f, 81.73f, 0.614315f}, + {-10989.4f, -1885.88f, 81.73f, 0.904913f}, + {-10978.1f, -1887.07f, 81.73f, 2.035550f}, + {-10975.9f, -1885.81f, 81.73f, 2.253890f}, }; const uint32 Adds[6]= @@ -137,7 +135,7 @@ public: Enrage = false; InVanish = false; - if (me->GetHealth()) + if (me->IsAlive()) SpawnAdds(); if (instance) @@ -183,39 +181,34 @@ public: void SpawnAdds() { DeSpawnAdds(); + if (isAddlistEmpty()) { - Creature* creature = NULL; - std::vector AddList; + std::list AddList; for (uint8 i = 0; i < 6; ++i) AddList.push_back(Adds[i]); - while (AddList.size() > 4) - AddList.erase((AddList.begin())+(rand()%AddList.size())); + Trinity::Containers::RandomResizeList(AddList, 4); uint8 i = 0; - for (std::vector::const_iterator itr = AddList.begin(); itr != AddList.end(); ++itr) + for (std::list::const_iterator itr = AddList.begin(); itr != AddList.end() && i < 4; ++itr, ++i) { uint32 entry = *itr; - creature = me->SummonCreature(entry, Locations[i][0], Locations[i][1], POS_Z, Locations[i][2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); - if (creature) + if (Creature* creature = me->SummonCreature(entry, Locations[i], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000)) { AddGUID[i] = creature->GetGUID(); AddId[i] = entry; } - ++i; } - }else + } + else { for (uint8 i = 0; i < 4; ++i) { - Creature* creature = me->SummonCreature(AddId[i], Locations[i][0], Locations[i][1], POS_Z, Locations[i][2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); - if (creature) - { + if (Creature* creature = me->SummonCreature(AddId[i], Locations[i], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000)) AddGUID[i] = creature->GetGUID(); - } } } } @@ -235,9 +228,8 @@ public: { if (AddGUID[i]) { - Creature* temp = Creature::GetCreature((*me), AddGUID[i]); - if (temp && temp->IsAlive()) - temp->DisappearAndDie(); + if (Creature* temp = ObjectAccessor::GetCreature(*me, AddGUID[i])) + temp->DespawnOrUnsummon(); } } } diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index 4efdf78154d..f12c68678b1 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -1575,130 +1575,95 @@ public: ## npc_brewfest_reveler ####*/ +enum BrewfestReveler +{ + SPELL_BREWFEST_TOAST = 41586 +}; + class npc_brewfest_reveler : public CreatureScript { -public: - npc_brewfest_reveler() : CreatureScript("npc_brewfest_reveler") { } + public: + npc_brewfest_reveler() : CreatureScript("npc_brewfest_reveler") { } - struct npc_brewfest_revelerAI : public ScriptedAI - { - npc_brewfest_revelerAI(Creature* creature) : ScriptedAI(creature) {} - void ReceiveEmote(Player* player, uint32 emote) OVERRIDE + struct npc_brewfest_revelerAI : public ScriptedAI { - if (!IsHolidayActive(HOLIDAY_BREWFEST)) - return; + npc_brewfest_revelerAI(Creature* creature) : ScriptedAI(creature) { } - if (emote == TEXT_EMOTE_DANCE) - me->CastSpell(player, 41586, false); - } - }; + void ReceiveEmote(Player* player, uint32 emote) OVERRIDE + { + if (!IsHolidayActive(HOLIDAY_BREWFEST)) + return; - CreatureAI* GetAI(Creature* creature) const OVERRIDE - { - return new npc_brewfest_revelerAI(creature); - } + if (emote == TEXT_EMOTE_DANCE) + me->CastSpell(player, SPELL_BREWFEST_TOAST, false); + } + }; + + CreatureAI* GetAI(Creature* creature) const OVERRIDE + { + return new npc_brewfest_revelerAI(creature); + } }; +enum Mojo +{ + SAY_MOJO = 0, -#define SAY_RANDOM_MOJO0 "Now that's what I call froggy-style!" -#define SAY_RANDOM_MOJO1 "Your lily pad or mine?" -#define SAY_RANDOM_MOJO2 "This won't take long, did it?" -#define SAY_RANDOM_MOJO3 "I thought you'd never ask!" -#define SAY_RANDOM_MOJO4 "I promise not to give you warts..." -#define SAY_RANDOM_MOJO5 "Feelin' a little froggy, are ya?" -#define SAY_RANDOM_MOJO6a "Listen, " -#define SAY_RANDOM_MOJO6b ", I know of a little swamp not too far from here...." -#define SAY_RANDOM_MOJO7 "There's just never enough Mojo to go around..." + SPELL_FEELING_FROGGY = 43906, + SPELL_SEDUCTION_VISUAL = 43919 +}; class npc_mojo : public CreatureScript { -public: - npc_mojo() : CreatureScript("npc_mojo") { } + public: + npc_mojo() : CreatureScript("npc_mojo") { } - struct npc_mojoAI : public ScriptedAI - { - npc_mojoAI(Creature* creature) : ScriptedAI(creature) {Reset();} - uint32 hearts; - uint64 victimGUID; - void Reset() OVERRIDE + struct npc_mojoAI : public ScriptedAI { - victimGUID = 0; - hearts = 15000; - if (Unit* own = me->GetOwner()) - me->GetMotionMaster()->MoveFollow(own, 0, 0); - } - - void EnterCombat(Unit* /*who*/)OVERRIDE {} + npc_mojoAI(Creature* creature) : ScriptedAI(creature) { } - void UpdateAI(uint32 diff) OVERRIDE - { - if (me->HasAura(20372)) + void Reset() OVERRIDE { - if (hearts <= diff) - { - me->RemoveAurasDueToSpell(20372); - hearts = 15000; - } hearts -= diff; - } - } + _victimGUID = 0; - void ReceiveEmote(Player* player, uint32 emote) OVERRIDE - { - me->HandleEmoteCommand(emote); - Unit* owner = me->GetOwner(); - if (emote != TEXT_EMOTE_KISS || !owner || owner->GetTypeId() != TYPEID_PLAYER || - owner->ToPlayer()->GetTeam() != player->GetTeam()) - { - return; + if (Unit* owner = me->GetOwner()) + me->GetMotionMaster()->MoveFollow(owner, 0.0f, 0.0f); } - std::string whisp = ""; - switch (rand() % 8) + void EnterCombat(Unit* /*who*/) OVERRIDE { } + void UpdateAI(uint32 diff) OVERRIDE { } + + void ReceiveEmote(Player* player, uint32 emote) OVERRIDE { - case 0: - whisp.append(SAY_RANDOM_MOJO0); - break; - case 1: - whisp.append(SAY_RANDOM_MOJO1); - break; - case 2: - whisp.append(SAY_RANDOM_MOJO2); - break; - case 3: - whisp.append(SAY_RANDOM_MOJO3); - break; - case 4: - whisp.append(SAY_RANDOM_MOJO4); - break; - case 5: - whisp.append(SAY_RANDOM_MOJO5); - break; - case 6: - whisp.append(SAY_RANDOM_MOJO6a); - whisp.append(player->GetName()); - whisp.append(SAY_RANDOM_MOJO6b); - break; - case 7: - whisp.append(SAY_RANDOM_MOJO7); - break; + me->HandleEmoteCommand(emote); + Unit* owner = me->GetOwner(); + if (emote != TEXT_EMOTE_KISS || !owner || owner->GetTypeId() != TYPEID_PLAYER || + owner->ToPlayer()->GetTeam() != player->GetTeam()) + { + return; + } + + Talk(SAY_MOJO, player->GetGUID()); + + if (_victimGUID) + if (Player* victim = ObjectAccessor::GetPlayer(*me, _victimGUID)) + victim->RemoveAura(SPELL_FEELING_FROGGY); + + _victimGUID = player->GetGUID(); + + DoCast(player, SPELL_FEELING_FROGGY, true); + DoCast(me, SPELL_SEDUCTION_VISUAL, true); + me->GetMotionMaster()->MoveFollow(player, 0.0f, 0.0f); } - me->MonsterWhisper(whisp.c_str(), player->GetGUID()); - if (victimGUID) - if (Player* victim = ObjectAccessor::GetPlayer(*me, victimGUID)) - victim->RemoveAura(43906); // remove polymorph frog thing - me->AddAura(43906, player); // add polymorph frog thing - victimGUID = player->GetGUID(); - DoCast(me, 20372, true); // tag.hearts - me->GetMotionMaster()->MoveFollow(player, 0, 0); - hearts = 15000; - } - }; + private: + uint64 _victimGUID; + }; - CreatureAI* GetAI(Creature* creature) const OVERRIDE - { - return new npc_mojoAI(creature); - } + CreatureAI* GetAI(Creature* creature) const OVERRIDE + { + return new npc_mojoAI(creature); + } }; enum TrainingDummy -- cgit v1.2.3 From b1721a65ee7595b99269d01cdccd7aa6557ab099 Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Sat, 31 Aug 2013 17:42:04 +0200 Subject: Core/Spells: Fix quest credit for quest "Death Comes From On High" --- .../2013_08_31_04_world_spell_script_names.sql | 3 + src/server/scripts/Spells/spell_quest.cpp | 74 ++++++++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100644 sql/updates/world/2013_08_31_04_world_spell_script_names.sql (limited to 'sql/updates') diff --git a/sql/updates/world/2013_08_31_04_world_spell_script_names.sql b/sql/updates/world/2013_08_31_04_world_spell_script_names.sql new file mode 100644 index 00000000000..a1f71f3c870 --- /dev/null +++ b/sql/updates/world/2013_08_31_04_world_spell_script_names.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_script_names` WHERE `spell_id`=51858; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(51858, 'spell_q12641_death_comes_from_on_high'); diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index 7b9821c60a9..7021f6251a2 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -2034,6 +2034,79 @@ class spell_q12308_escape_from_silverbrook_summon_worgen : public SpellScriptLoa } }; + +enum DeathComesFromOnHigh +{ + SPELL_FORGE_CREDIT = 51974, + SPELL_TOWN_HALL_CREDIT = 51977, + SPELL_SCARLET_HOLD_CREDIT = 51980, + SPELL_CHAPEL_CREDIT = 51982, + + NPC_NEW_AVALON_FORGE = 28525, + NPC_NEW_AVALON_TOWN_HALL = 28543, + NPC_SCARLET_HOLD = 28542, + NPC_CHAPEL_OF_THE_CRIMSON_FLAME = 28544 +}; + +// 51858 - Siphon of Acherus +class spell_q12641_death_comes_from_on_high : public SpellScriptLoader +{ + public: + spell_q12641_death_comes_from_on_high() : SpellScriptLoader("spell_q12641_death_comes_from_on_high") { } + + class spell_q12641_death_comes_from_on_high_SpellScript : public SpellScript + { + PrepareSpellScript(spell_q12641_death_comes_from_on_high_SpellScript); + + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE + { + if (!sSpellMgr->GetSpellInfo(SPELL_FORGE_CREDIT) || + !sSpellMgr->GetSpellInfo(SPELL_TOWN_HALL_CREDIT) || + !sSpellMgr->GetSpellInfo(SPELL_SCARLET_HOLD_CREDIT) || + !sSpellMgr->GetSpellInfo(SPELL_CHAPEL_CREDIT)) + return false; + return true; + } + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + uint32 spellId = 0; + + TC_LOG_ERROR(LOG_FILTER_SPELLS_AURAS, "spell_q12641_death_comes_from_on_high:: Caster: %s (GUID: %u) On Hit Target: Creature: %s (Entry: %u GUID: %u)", + GetOriginalCaster()->GetName().c_str(), GetOriginalCaster()->GetGUIDLow(), GetHitCreature()->GetName().c_str(), GetHitCreature()->GetEntry(), GetHitCreature()->GetGUIDLow()); + switch (GetHitCreature()->GetEntry()) + { + case NPC_NEW_AVALON_FORGE: + spellId = SPELL_FORGE_CREDIT; + break; + case NPC_NEW_AVALON_TOWN_HALL: + spellId = SPELL_TOWN_HALL_CREDIT; + break; + case NPC_SCARLET_HOLD: + spellId = SPELL_SCARLET_HOLD_CREDIT; + break; + case NPC_CHAPEL_OF_THE_CRIMSON_FLAME: + spellId = SPELL_CHAPEL_CREDIT; + break; + default: + return; + } + + GetOriginalCaster()->CastSpell((Unit*)NULL, spellId, true); + } + + void Register() OVERRIDE + { + OnEffectHitTarget += SpellEffectFn(spell_q12641_death_comes_from_on_high_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const OVERRIDE + { + return new spell_q12641_death_comes_from_on_high_SpellScript(); + } +}; + void AddSC_quest_spell_scripts() { new spell_q55_sacred_cleansing(); @@ -2083,4 +2156,5 @@ void AddSC_quest_spell_scripts() new spell_q12690_burst_at_the_seams(); new spell_q12308_escape_from_silverbrook_summon_worgen(); new spell_q12308_escape_from_silverbrook(); + new spell_q12641_death_comes_from_on_high(); } -- cgit v1.2.3 From 842b8077576b4ad65d55a78a8c6f47744e0c9ff4 Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Sat, 31 Aug 2013 17:54:07 +0200 Subject: DB/Creature: Add missing sql in 8fd1f461929d78054b72f00483ad057d0e80a238 --- sql/updates/world/2013_08_31_05_world_creature_template.sql | 1 + 1 file changed, 1 insertion(+) create mode 100644 sql/updates/world/2013_08_31_05_world_creature_template.sql (limited to 'sql/updates') diff --git a/sql/updates/world/2013_08_31_05_world_creature_template.sql b/sql/updates/world/2013_08_31_05_world_creature_template.sql new file mode 100644 index 00000000000..8bd02b1de1a --- /dev/null +++ b/sql/updates/world/2013_08_31_05_world_creature_template.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName`='npc_pet_gen_mojo' WHERE `ScriptName`='npc_mojo'; -- cgit v1.2.3 From e753a47162b0417ee74b91e2ec04fe7716c16c99 Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Sat, 31 Aug 2013 18:29:51 +0200 Subject: DB/Sai: Fix quest credit for quest "Blessing of Incineratus" --- sql/updates/world/2013_08_31_06_world_smart_scripts.sql | 10 ++++++++++ src/server/scripts/Pet/pet_generic.cpp | 1 + 2 files changed, 11 insertions(+) create mode 100644 sql/updates/world/2013_08_31_06_world_smart_scripts.sql (limited to 'sql/updates') diff --git a/sql/updates/world/2013_08_31_06_world_smart_scripts.sql b/sql/updates/world/2013_08_31_06_world_smart_scripts.sql new file mode 100644 index 00000000000..9376bb62951 --- /dev/null +++ b/sql/updates/world/2013_08_31_06_world_smart_scripts.sql @@ -0,0 +1,10 @@ +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (18110,18142,18143,18144) AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(18110, 0, 0, 1, 8, 0, 100, 1, 31927, 0, 0, 0, 80, 1811000, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Windyreed Quest Credit - On Spellhit - Run Script'), +(18110, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 33, 18110, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Windyreed Quest Credit - On Spellhit (Link) - Quest Credit'), +(18142, 0, 0, 1, 8, 0, 100, 1, 31927, 0, 0, 0, 80, 1814200, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Windyreed Quest Credit - On Spellhit - Run Script'), +(18142, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 33, 18142, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Windyreed Quest Credit - On Spellhit (Link) - Quest Credit'), +(18143, 0, 0, 1, 8, 0, 100, 1, 31927, 0, 0, 0, 80, 1814300, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Windyreed Quest Credit - On Spellhit - Run Script'), +(18143, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 33, 18143, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Windyreed Quest Credit - On Spellhit (Link) - Quest Credit'), +(18144, 0, 0, 1, 8, 0, 100, 1, 31927, 0, 0, 0, 80, 1814400, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Windyreed Quest Credit - On Spellhit - Run Script'), +(18144, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 33, 18144, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Windyreed Quest Credit - On Spellhit (Link) - Quest Credit'); diff --git a/src/server/scripts/Pet/pet_generic.cpp b/src/server/scripts/Pet/pet_generic.cpp index f4327ef8daa..b8df19f4216 100644 --- a/src/server/scripts/Pet/pet_generic.cpp +++ b/src/server/scripts/Pet/pet_generic.cpp @@ -87,4 +87,5 @@ class npc_pet_gen_mojo : public CreatureScript void AddSC_shaman_pet_scripts() { + new npc_pet_gen_mojo(); } -- cgit v1.2.3 From 22b71244a0e9caccf7d9ab9ed770f27f6486d904 Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Sat, 31 Aug 2013 19:33:14 +0200 Subject: DB/Creature: Fix cords for quest "Death Comes From On High" --- sql/updates/world/2013_08_31_07_world_creature.sql | 26 ++++++++++++++++++++++ src/server/game/Scripting/ScriptLoader.cpp | 2 ++ src/server/scripts/Pet/pet_generic.cpp | 2 +- 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 sql/updates/world/2013_08_31_07_world_creature.sql (limited to 'sql/updates') diff --git a/sql/updates/world/2013_08_31_07_world_creature.sql b/sql/updates/world/2013_08_31_07_world_creature.sql new file mode 100644 index 00000000000..04f844d68c0 --- /dev/null +++ b/sql/updates/world/2013_08_31_07_world_creature.sql @@ -0,0 +1,26 @@ +UPDATE `creature` SET + `position_x`=1814.592, + `position_y`=-5988.646, + `position_z`=125.4968, + `orientation`=3.228859 +WHERE `id`=28525; + +UPDATE `creature` SET + `position_x`=1590.806, + `position_y`=-5731.661, + `position_z`=143.8694, + `orientation`=0.9075712 +WHERE `id`=28543; + +UPDATE `creature` SET + `position_x`= 1651.211, + `position_y`=-5994.667, + `position_z`=133.5836 +WHERE `id`=28542; + +UPDATE `creature` SET `position_x`= 1385.928, + `position_x`=1385.928, + `position_y`= -5702.061, + `position_z`= 146.3048, + `orientation`=4.153883 +WHERE `id`=28544; diff --git a/src/server/game/Scripting/ScriptLoader.cpp b/src/server/game/Scripting/ScriptLoader.cpp index 426d83ef837..3456041ddb2 100644 --- a/src/server/game/Scripting/ScriptLoader.cpp +++ b/src/server/game/Scripting/ScriptLoader.cpp @@ -654,6 +654,7 @@ void AddSC_event_childrens_week(); // Pets void AddSC_deathknight_pet_scripts(); +void AddSC_generic_pet_scripts(); void AddSC_hunter_pet_scripts(); void AddSC_mage_pet_scripts(); void AddSC_priest_pet_scripts(); @@ -1359,6 +1360,7 @@ void AddPetScripts() { #ifdef SCRIPTS AddSC_deathknight_pet_scripts(); + AddSC_generic_pet_scripts(); AddSC_hunter_pet_scripts(); AddSC_mage_pet_scripts(); AddSC_priest_pet_scripts(); diff --git a/src/server/scripts/Pet/pet_generic.cpp b/src/server/scripts/Pet/pet_generic.cpp index b8df19f4216..f10a14716c6 100644 --- a/src/server/scripts/Pet/pet_generic.cpp +++ b/src/server/scripts/Pet/pet_generic.cpp @@ -85,7 +85,7 @@ class npc_pet_gen_mojo : public CreatureScript } }; -void AddSC_shaman_pet_scripts() +void AddSC_generic_pet_scripts() { new npc_pet_gen_mojo(); } -- cgit v1.2.3