comparison Main.lua @ 26:565af5d2002a

Account for the fact that a single NPC ID can instantiate more than one gender.
author James D. Callahan III <jcallahan@curse.com>
date Wed, 16 May 2012 12:35:19 -0500
parents e681130c2144
children 120740b8a54f
comparison
equal deleted inserted replaced
25:e681130c2144 26:565af5d2002a
734 if faction_names[line_text] then 734 if faction_names[line_text] then
735 npc.faction = line_text 735 npc.faction = line_text
736 break 736 break
737 end 737 end
738 end 738 end
739 npc.gender = GENDER_NAMES[_G.UnitSex("target")] or "UNDEFINED" 739 npc.genders = npc.genders or {}
740 npc.genders[GENDER_NAMES[_G.UnitSex("target")] or "UNDEFINED"] = true
740 npc.is_pvp = _G.UnitIsPVP("target") and true or nil 741 npc.is_pvp = _G.UnitIsPVP("target") and true or nil
741 npc.reaction = ("%s:%s:%s"):format(_G.UnitLevel("player"), _G.UnitFactionGroup("player"), REACTION_NAMES[_G.UnitReaction("player", "target")]) 742 npc.reaction = ("%s:%s:%s"):format(_G.UnitLevel("player"), _G.UnitFactionGroup("player"), REACTION_NAMES[_G.UnitReaction("player", "target")])
742 npc.encounter_data = npc.encounter_data or {} 743 npc.encounter_data = npc.encounter_data or {}
743 744
744 local npc_level = ("level_%d"):format(_G.UnitLevel("target")) 745 local npc_level = ("level_%d"):format(_G.UnitLevel("target"))