Core/Conditions: Implemented new condition source type CONDITION_SOURCE_TYPE_PLAYER_CHOICE_RESPONSE
Port From (https://github.com/TrinityCore/TrinityCore/commit/952f3227108bac415d01f898963ee65bd4d58123)
This commit is contained in:
@@ -290,6 +290,17 @@ namespace Game
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool IsObjectMeetingPlayerChoiceResponseConditions(uint playerChoiceId, int playerChoiceResponseId, Player player)
|
||||
{
|
||||
var list = ConditionStorage[ConditionSourceType.PlayerChoiceResponse].LookupByKey(new ConditionId(playerChoiceId, playerChoiceResponseId, 0));
|
||||
if (list != null)
|
||||
{
|
||||
Log.outDebug(LogFilter.Condition, $"GetConditionsForNpcVendor: found conditions for creature entry {playerChoiceId} item {playerChoiceResponseId}");
|
||||
return IsObjectMeetToConditions(player, list);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool IsSpellUsedInSpellClickConditions(uint spellId)
|
||||
{
|
||||
return spellsUsedInSpellClickConditions.Contains(spellId);
|
||||
@@ -1135,6 +1146,21 @@ namespace Game
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ConditionSourceType.PlayerChoiceResponse:
|
||||
{
|
||||
PlayerChoice playerChoice = Global.ObjectMgr.GetPlayerChoice((int)cond.SourceGroup);
|
||||
if (playerChoice == null)
|
||||
{
|
||||
Log.outError(LogFilter.Sql, $"{cond} SourceGroup in `condition` table, does not exist in `playerchoice`, ignoring.");
|
||||
return false;
|
||||
}
|
||||
if (playerChoice.GetResponse(cond.SourceEntry) == null)
|
||||
{
|
||||
Log.outError(LogFilter.Sql, $"{cond} SourceEntry in `condition` table, does not exist in `playerchoice_response`, ignoring.");
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ConditionSourceType.GossipMenu:
|
||||
case ConditionSourceType.GossipMenuOption:
|
||||
case ConditionSourceType.SmartEvent:
|
||||
|
||||
Reference in New Issue
Block a user