# HG changeset patch # User James D. Callahan III # Date 1349708383 18000 # Node ID b5ced741f9e6f28383b0abe9f251e66fe2772263 # Parent f26de5e5b83813cc383e280cabdc5ec26195a6c8 Added support for recording prices for trainer services - commented out for now. diff -r f26de5e5b838 -r b5ced741f9e6 Main.lua --- a/Main.lua Sun Oct 07 01:31:57 2012 -0500 +++ b/Main.lua Mon Oct 08 09:59:43 2012 -0500 @@ -1792,12 +1792,13 @@ function WDP:TRAINER_SHOW(event_name) local unit_type, unit_idnum = ParseGUID(_G.UnitGUID("target")) - local npc = NPCEntry(unit_idnum) + local trainer = NPCEntry(unit_idnum) - if not npc then + if not trainer then return end - npc.teaches = npc.teaches or {} + local trainer_standing = select(2, UnitFactionStanding("target")) + trainer.teaches = trainer.teaches or {} -- Get the initial trainer filters local available = _G.GetTrainerServiceTypeFilter("available") @@ -1819,20 +1820,22 @@ local _, _, spell_id = DatamineTT:GetSpell() if spell_id then + local class_professions = trainer.teaches[PLAYER_CLASS] + + if not class_professions then + trainer.teaches[PLAYER_CLASS] = {} + class_professions = trainer.teaches[PLAYER_CLASS] + end local profession, min_skill = _G.GetTrainerServiceSkillReq(index) profession = profession or "General" - local class_professions = npc.teaches[PLAYER_CLASS] - if not class_professions then - npc.teaches[PLAYER_CLASS] = {} - class_professions = npc.teaches[PLAYER_CLASS] - end + local profession_skills = class_professions[profession] - local profession_skills = class_professions[profession] if not profession_skills then class_professions[profession] = {} profession_skills = class_professions[profession] end +-- profession_skills[spell_id] = ("%d:%d:%d"):format(required_level, min_skill, ActualCopperCost(_G.GetTrainerServiceCost(index), trainer_standing)) profession_skills[spell_id] = ("%d:%d"):format(required_level, min_skill) end end