48 lines
		
	
	
		
			915 B
		
	
	
	
		
			Lua
		
	
	
	
	
	
			
		
		
	
	
			48 lines
		
	
	
		
			915 B
		
	
	
	
		
			Lua
		
	
	
	
	
	
| --TSU
 | |
| --CHAT_MSG_COMBAT_FACTION_CHANGE
 | |
| function(allstates,event,msg)
 | |
| 	for _,v in pairs(allstates) do
 | |
| 		v.show = false
 | |
| 		v.changed = true
 | |
| 	end
 | |
| 
 | |
| 	for k,v in ipairs(aura_env.reps) do
 | |
| 		local name,_,_,_,repmax,rep = GetFactionInfo(i)
 | |
| 		allstates[unit] = 
 | |
| 		{
 | |
| 			changed = true,
 | |
| 			show = true,
 | |
| 			resort = true,
 | |
| 			progressType = "static",
 | |
| 			value = rep,
 | |
| 			total = repmax,
 | |
| 			index = rep,
 | |
| 			name = repname,
 | |
| 		}
 | |
| 	end
 | |
| 	return true
 | |
| end
 | |
| 
 | |
| --CHAT_MSG_COMBAT_FACTION_CHANGE
 | |
| function(_,msg)
 | |
| 	local repname,change = msg:match("Reputation with ([%a+%s*%p*]+) increased by (%d+)")
 | |
| 	for i = 1, GetNumFactions() do
 | |
| 		local name,_,_,_,repmax,rep = GetFactionInfo(i)
 | |
| 		if name == repName then 
 | |
| 			local repIndex = i
 | |
| 		end
 | |
| 	end
 | |
| 	local isfound = 0
 | |
| 	for k,v in ipairs(aura_env.reps) do
 | |
| 		if v == name then
 | |
| 			isfound = 1
 | |
| 			break
 | |
| 		end
 | |
| 	end
 | |
| 	if isfound == 0 then
 | |
| 		table.insert(aura_env.reps, name)
 | |
| 	end
 | |
| end
 | |
| 
 | |
| --INIT
 | |
| aura_env.reps = {} |