Core/Conditions: Added CONDITION_SOURCE_TYPE_TRAINER_SPELL

Port From (https://github.com/TrinityCore/TrinityCore/commit/0d0f9784a92245879c1e98b011dc112b1b8bb76b)
This commit is contained in:
hondacrx
2021-12-07 16:49:45 -05:00
parent 7fa5a57738
commit 2ccf5b05e8
3 changed files with 66 additions and 12 deletions
+6
View File
@@ -45,6 +45,12 @@ namespace Game.Entities
if (!player.IsSpellFitByClassAndRace(trainerSpell.SpellId))
continue;
if (!Global.ConditionMgr.IsObjectMeetingTrainerSpellConditions(_id, trainerSpell.SpellId, player))
{
Log.outDebug(LogFilter.Condition, $"SendSpells: conditions not met for trainer id {_id} spell {trainerSpell.SpellId} player '{player.GetName()}' ({player.GetGUID()})");
continue;
}
TrainerListSpell trainerListSpell = new();
trainerListSpell.SpellID = trainerSpell.SpellId;
trainerListSpell.MoneyCost = (uint)(trainerSpell.MoneyCost * reputationDiscount);