mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 09:17:18 +00:00
fix(Core/Conditions): Add CONDITION_SOURCE_TYPE_QUEST_AVAILABLE (#2859)
* Merge CONDITION_SOURCE_TYPE_QUEST_ACCEPT & CONDITION_SOURCE_TYPE_QUEST_SHOW_MARK to CONDITION_SOURCE_TYPE_QUEST_AVAILABLE Co-authored-by: SnapperRy <snapperry@users.noreply.github.com> Co-authored-by: Aokromes <aokromes@gmail.com>
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1586422702320149000');
|
||||
|
||||
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=20;
|
||||
|
||||
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=19 AND `SourceEntry` IN (13044, 13068, 13086, 13104, 13105, 13120, 13139, 13224, 13225, 13604, 13817);
|
||||
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
|
||||
(19, 0, 13044, 0, 0, 8, 0, 13008, 0, 0, 0, 0, 0, "", ""),
|
||||
(19, 0, 13044, 0, 0, 8, 0, 13039, 0, 0, 0, 0, 0, "", ""),
|
||||
(19, 0, 13044, 0, 0, 8, 0, 13040, 0, 0, 0, 0, 0, "", ""),
|
||||
(19, 0, 13068, 0, 0, 8, 0, 13139, 0, 0, 0, 0, 0, "", ""),
|
||||
(19, 0, 13086, 0, 0, 8, 0, 13070, 0, 0, 0, 0, 0, "", ""),
|
||||
(19, 0, 13104, 0, 0, 8, 0, 13086, 0, 0, 0, 0, 0, "", ""),
|
||||
(19, 0, 13104, 0, 1, 15, 0, 1503, 0, 0, 0, 0, 0, "", "Show quest 13104 if player is not a Death Knight"),
|
||||
(19, 0, 13105, 0, 0, 8, 0, 13086, 0, 0, 0, 0, 0, "", ""),
|
||||
(19, 0, 13105, 0, 1, 15, 0, 32, 0, 0, 0, 0, 0, "", "Show quest 13105 if player is a Death Knight"),
|
||||
(19, 0, 13120, 0, 0, 8, 0, 13105, 0, 0, 0, 0, 0, "", ""),
|
||||
(19, 0, 13120, 0, 1, 8, 0, 13104, 0, 0, 0, 0, 0, "", ""),
|
||||
(19, 0, 13139, 0, 0, 8, 0, 13125, 0, 0, 0, 0, 0, "", ""),
|
||||
(19, 0, 13139, 0, 0, 8, 0, 13130, 0, 0, 0, 0, 0, "", ""),
|
||||
(19, 0, 13139, 0, 0, 8, 0, 13135, 0, 0, 0, 0, 0, "", ""),
|
||||
(19, 0, 13224, 0, 0, 8, 0, 13157, 0, 0, 0, 0, 0, "", ""),
|
||||
(19, 0, 13225, 0, 0, 8, 0, 13157, 0, 0, 0, 0, 0, "", ""),
|
||||
(19, 0, 13604, 0, 0, 19, 0, 1, 0, 0, 0, 0, 0, "", "Archivum Data Disc quest mark only shown in 10 man"),
|
||||
(19, 0, 13817, 0, 0, 19, 0, 2, 0, 0, 0, 0, 0, "", "Heroic: Archivum Data Disc quest mark only shown in 25 man");
|
||||
@@ -1552,19 +1552,15 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
|
||||
}
|
||||
break;
|
||||
}
|
||||
case CONDITION_SOURCE_TYPE_QUEST_ACCEPT:
|
||||
case CONDITION_SOURCE_TYPE_QUEST_AVAILABLE:
|
||||
if (!sObjectMgr->GetQuestTemplate(cond->SourceEntry))
|
||||
{
|
||||
sLog->outErrorDb("CONDITION_SOURCE_TYPE_QUEST_ACCEPT specifies non-existing quest (%u), skipped", cond->SourceEntry);
|
||||
sLog->outErrorDb("CONDITION_SOURCE_TYPE_QUEST_AVAILABLE specifies non-existing quest (%u), skipped", cond->SourceEntry);
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case CONDITION_SOURCE_TYPE_QUEST_SHOW_MARK:
|
||||
if (!sObjectMgr->GetQuestTemplate(cond->SourceEntry))
|
||||
{
|
||||
sLog->outErrorDb("CONDITION_SOURCE_TYPE_QUEST_SHOW_MARK specifies non-existing quest (%u), skipped", cond->SourceEntry);
|
||||
return false;
|
||||
}
|
||||
case CONDITION_SOURCE_TYPE_UNUSED_20:
|
||||
sLog->outErrorDb("CONDITION_SOURCE_TYPE_UNUSED_20 is not in use. SourceEntry = (%u), skipped", cond->SourceEntry);
|
||||
break;
|
||||
case CONDITION_SOURCE_TYPE_VEHICLE_SPELL:
|
||||
case CONDITION_SOURCE_TYPE_SPELL_CLICK_EVENT:
|
||||
|
||||
@@ -126,8 +126,8 @@ enum ConditionSourceType
|
||||
CONDITION_SOURCE_TYPE_CREATURE_TEMPLATE_VEHICLE = 16,
|
||||
CONDITION_SOURCE_TYPE_SPELL = 17,
|
||||
CONDITION_SOURCE_TYPE_SPELL_CLICK_EVENT = 18,
|
||||
CONDITION_SOURCE_TYPE_QUEST_ACCEPT = 19,
|
||||
CONDITION_SOURCE_TYPE_QUEST_SHOW_MARK = 20,
|
||||
CONDITION_SOURCE_TYPE_QUEST_AVAILABLE = 19,
|
||||
CONDITION_SOURCE_TYPE_UNUSED_20 = 20, // placeholder
|
||||
CONDITION_SOURCE_TYPE_VEHICLE_SPELL = 21,
|
||||
CONDITION_SOURCE_TYPE_SMART_EVENT = 22,
|
||||
CONDITION_SOURCE_TYPE_NPC_VENDOR = 23,
|
||||
|
||||
@@ -16308,8 +16308,8 @@ bool Player::SatisfyQuestStatus(Quest const* qInfo, bool msg) const
|
||||
}
|
||||
|
||||
bool Player::SatisfyQuestConditions(Quest const* qInfo, bool msg)
|
||||
{
|
||||
ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_QUEST_ACCEPT, qInfo->GetQuestId());
|
||||
{
|
||||
ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_QUEST_AVAILABLE, qInfo->GetQuestId());
|
||||
if (!sConditionMgr->IsObjectMeetToConditions(this, conditions))
|
||||
{
|
||||
if (msg)
|
||||
@@ -16766,7 +16766,7 @@ QuestGiverStatus Player::GetQuestDialogStatus(Object* questgiver)
|
||||
if (!quest)
|
||||
continue;
|
||||
|
||||
ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_QUEST_SHOW_MARK, quest->GetQuestId());
|
||||
ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_QUEST_AVAILABLE, quest->GetQuestId());
|
||||
if (!sConditionMgr->IsObjectMeetToConditions(this, conditions))
|
||||
continue;
|
||||
|
||||
@@ -16794,7 +16794,7 @@ QuestGiverStatus Player::GetQuestDialogStatus(Object* questgiver)
|
||||
if (!quest)
|
||||
continue;
|
||||
|
||||
ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_QUEST_SHOW_MARK, quest->GetQuestId());
|
||||
ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_QUEST_AVAILABLE, quest->GetQuestId());
|
||||
if (!sConditionMgr->IsObjectMeetToConditions(this, conditions))
|
||||
continue;
|
||||
|
||||
|
||||
@@ -584,7 +584,7 @@ class npc_wg_quest_giver : public CreatureScript
|
||||
if (!quest)
|
||||
continue;
|
||||
|
||||
ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_QUEST_SHOW_MARK, quest->GetQuestId());
|
||||
ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_QUEST_AVAILABLE, quest->GetQuestId());
|
||||
if (!sConditionMgr->IsObjectMeetToConditions(player, conditions))
|
||||
continue;
|
||||
|
||||
@@ -612,7 +612,7 @@ class npc_wg_quest_giver : public CreatureScript
|
||||
if (!quest)
|
||||
continue;
|
||||
|
||||
ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_QUEST_SHOW_MARK, quest->GetQuestId());
|
||||
ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_QUEST_AVAILABLE, quest->GetQuestId());
|
||||
if (!sConditionMgr->IsObjectMeetToConditions(player, conditions))
|
||||
continue;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user