comparison Main.lua @ 33:6422f3b61962

Count the number of times an NPC has been looted on a per-droptype basis.
author James D. Callahan III <jcallahan@curse.com>
date Mon, 04 Jun 2012 12:02:28 -0500
parents 81d7d84df629
children 2a094108d89b
comparison
equal deleted inserted replaced
32:81d7d84df629 33:6422f3b61962
553 if not npc then 553 if not npc then
554 return 554 return
555 end 555 end
556 local encounter_data = npc.encounter_data[InstanceDifficultyToken()] 556 local encounter_data = npc.encounter_data[InstanceDifficultyToken()]
557 local loot_type = action_data.label or "drops" 557 local loot_type = action_data.label or "drops"
558 npc.loot_counts = npc.loot_counts or {}
559 npc.loot_counts[loot_type] = (npc.loot_counts[loot_type] or 0) + 1
558 encounter_data[loot_type] = encounter_data[loot_type] or {} 560 encounter_data[loot_type] = encounter_data[loot_type] or {}
559 561
560 for index = 1, #action_data.loot_list do 562 for index = 1, #action_data.loot_list do
561 table.insert(encounter_data[loot_type], action_data.loot_list[index]) 563 table.insert(encounter_data[loot_type], action_data.loot_list[index])
562 end 564 end