Advertisement
Guest User

Untitled

a guest
Feb 7th, 2016
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. function Mercs_Levies_GetClass(unit_key, curr_char)
  2. PopLog("Start", "Mercs_Levies_GetClass()")
  3. local class = 4
  4.  
  5. if curr_char:region():garrison_residence():faction():name() ~= curr_char:faction():name()
  6. then class = UIRetrieveClass(unit_key, unit_to_pop_table)
  7. return class
  8. end
  9.  
  10. PopLog("Start class key check", "Mercs_Levies_GetClass()")
  11. local class_key = Mercs_Levies_LocalClass()
  12. PopLog("Get Class Key: "..class_key, "Mercs_Levies_GetClass()")
  13. if class_key and curr_char:region():garrison_residence():faction():name() == curr_char:faction():name() then
  14. for i, unit in pairs (mercenary_units_to_faction_class[class_key]) do
  15. if unit == unit_key
  16. then class = UIRetrieveClass(unit_key, unit_to_pop_table)
  17. end
  18. end
  19. end
  20. return class
  21. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement